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
"
LEN
A
function
that determines how
long
a
string
is, i.e. the
character count
Character Code
The
numeric
value of a
character
in a the
character set.
In ASCII, "A" is
65
POSITION
A
function
that returns the
numeric location
of a
character
within a
larger string
(counting from
0
)
Concatenation
Joining
two strings
together, usually uses the
+ operator
, for example
fullname
=
firstname
+
lastname
SUBSTRING
A function in
pseudo-code
that
returns
part of a
string
when we pass it a
starting position
and
length
"Char"
The
string
returned by this
pseudo-code
:
SUBSTRING
(0, 4, "
Character
")
6
The value returned by this
pseudo-code
(assuming count starts at
zero
):
POSITION
("
Character
", "t")
"
Charlie
"
The result of the expression "Cha" + "rlie"
STRING_TO_INT
A
casting
function that changes a
string
to an
integer
, if the
string
contains only
numeric
characters
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
INT_TO_STRING
A
casting
function that changes an
integer
to a
string
REAL_TO_STRING
A
casting
function that changes a
real
number to a
string
Data
type
The kind of
data
a
variable
contains, it can be
character
,
string
,
integer
,
real
or
boolean
Character
The
data type
of a
single character
e.g. "
A
" or "
$
"
Casting
Changing
the
data type
using a
function
such as
STRING
_
TO
_
INT
() or
REAL
_
TO
_STRING
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
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
"
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