Save
...
computer science
programming
GCSE (9-1): Computer Science: AQA: String Operations
Save
Share
Learn
Content
Leaderboard
Learn
Created by
lucy dock
Visit profile
Cards (19)
String
This data type stores a
series
of
characters
, e.g. "
Zak
", "
MK44 5AB
" or "
123456789
"
View source
LEN
A
function
that determines how
long
a
string
is, i.e. the
character count
View source
Character Code
The
numeric
value of a
character
in a the
character set.
In ASCII, "A" is
65
View source
POSITION
A
function
that returns the
numeric location
of a
character
within a
larger string
(counting from
0
)
View source
Concatenation
Joining
two strings
together, usually uses the
+ operator
, for example
fullname
=
firstname
+
lastname
View source
SUBSTRING
A function in
pseudo-code
that
returns
part of a
string
when we pass it a
starting position
and
length
View source
"Char"
The
string
returned by this
pseudo-code
:
SUBSTRING
(0, 4, "
Character
")
View source
6
The value returned by this
pseudo-code
(assuming count starts at
zero
):
POSITION
("
Character
", "t")
View source
"
Charlie
"
The result of the expression "Cha" + "rlie"
View source
STRING_TO_INT
A
casting
function that changes a
string
to an
integer
, if the
string
contains only
numeric
characters
View source
STRING_TO_REAL
A
casting
function that changes a
string
to a
real number
, if the string contains only
numeric characters
and a
decimal point
View source
INT_TO_STRING
A
casting
function that changes an
integer
to a
string
View source
REAL_TO_STRING
A
casting
function that changes a
real
number to a
string
View source
Data
type
The kind of
data
a
variable
contains, it can be
character
,
string
,
integer
,
real
or
boolean
View source
Character
The
data type
of a
single character
e.g. "
A
" or "
$
"
View source
Casting
Changing
the
data type
using a
function
such as
STRING
_
TO
_
INT
() or
REAL
_
TO
_STRING
View source
STRING
_
TO
_
INT
(
'12'
)
This AQA standard pseudo-code expression uses a
casting function
to change a
string
to an
integer
and results in the
integer
value
12
View source
REAL_TO_STRING(12.8)
This
AQA
standard
pseudo-code
expression uses a
casting
function to change a
real
to a
string
and results in the
string
value "
12.8
"
View source
STRING
_
TO
_
REAL
(
'12.8'
)
This AQA standard pseudo-code expression uses a
casting function
to change a
string
to a
real
and results in the
real value
12.8
View source