Operations for character strings

Survey of all available operations:

String operations:

Adding of strings

With + 2 strings are combined.
V.E.str = "Hello" + " world!"
(-> Result is "Hello world!")

+

Identification of
left partial string

LEFT determines the left starting string of a string. Based on the first character, get nbr characters from string str.

V.E.str = LEFT["Hello world!",5]
(-> Result is "Hello")

LEFT[str, nbr]

Identification of
mean partial string

MID determines the partial string of a string. Starting with the character at position pos, get nbr characters from string str.

V.E.str = MID["How are you?", 3,5]
(-> Result is "are")

MID[str, nbr, pos]

Identification of
right partial string

RIGHT determines the right closing string of a string. Based on the last character, get nbr characters from string str.

V.E.str = RIGHT["Hello world! How are you?", 12]
(-> Result is "How are you?")

RIGHT[str, nbr]

Identification of
string length

LEN determines the length (number of characters) of a string.

P1 = LEN["Hello world! How are you?"]
(-> Result is 25)

LEN[str]

Operations for character strings 1:

FIND[..] is case sensitive!

Searching a
partial string

FIND searches a string str2 in a string str1 and determines the position of the first matching of str2 in str1 as a result.

V.E.str1 = "Hello world! How are you?"
V.E.str2 = "How"
P1 = FIND[V.E.str1, V.E.str2]
(-> Result is 14)

If string str2 does not exist in string str1, FIND determines value 0 as a result.

V.E.str1 = "Hello world! How are you?"
V.E.str2 = "today"
P1 = FIND[V.E.str1, V.E.str2]
(-> Result is 0)

FIND[str1, str2]

Deleting a
partial string

DELETE deletes in string str a number of certain characters nbr, starting with the character at position pos.

V.E.str = DELETE["Hello world! How are you?", 5, 7]
(->Result is "Hello ! How are
you?")

DELETE[str, nbr, pos]

Inserting a
partial string

INSERT inserts a string str2 into a string str1, starting behind the character at position pos.

V.E.str1 = "Hello ! How are you?"
V.E.str2 = "world"
V.E.str = INSERT[V.E.str1, V.E.str2, 6]
(-> Result is "Hello world! How are
you?")

INSERT[str1, str2, pos]

Replacing a partial string

REPLACE replaces a number of characters nbr in string str1 by a partial string str2, starting with the character at position pos.

V.E.str1 = "What is your name?"
V.E.str2 = "age"
V.E.str = REPLACE[V.E.str1,
V.E.str2, 4, 14]
(->Result is "What is your age?")

REPLACE[str1, str2, nbr, pos]

Comparison operators:

Operations for character strings 2:

The comparison operations are case sensitive!

Equality

V.E.str1 = "Peter"
V.E.str2 = "Peter"
$IF V.E.str1 == V.E.str2
 #MSG ["%s is equal to %s!", V.E.str1,V.E.str2]
$ELSE
 #MSG ["Strings are not equal!"]
$ENDIF
(-> Result is "Peter is equal to Peter")

==

Inequality

V.E.str1 = "Peter"
V.E.str2 = "Steve"
$IF V.E.str1 != V.E.str2
 #MSG ["%s is not equal to %s!", V.E.str1,V.E.str2]
$ELSE
 #MSG ["Strings are equal!"]
$ENDIF
(-> Result is "Peter is not equal to Steve")

!=

greater than

/

greater than or equal to

V.E.str1 = "Peter"
V.E.str2 = "Peter"
$IF V.E.str1 > V.E.str2
 #MSG ["%s is greater than %s!", V.E.str1, V.E.str2]
$ELSEIF V.E.str1 >= V.E.str2
#MSG ["%s is greater than or equal to %s!", V.E.str1, V.E.str2]
$ENDIF
(-> Result is "Peter is greater than or equal to Peter!")
V.E.str1 = "Peter"
V.E.str2 = "Bob"
$IF V.E.str1 > V.E.str2
 #MSG ["%s is greater than %s!", V.E.str1, V.E.str2]
$ELSEIF V.E.str1 >= V.E.str2
 #MSG ["%s is greater than or equal to %s!", V.E.str1, V.E.str2]
$ENDIF
(-> Result is "Peter is greater than
Bob!")

>

>=

less than

/

less than or equal to

V.E.str1 = "Peter"
V.E.str2 = "Peter"
$IF V.E.str1 < V.E.str2
 #MSG ["%s is less than %s!", V.E.str1, V.E.str2]
$ELSEIF V.E.str1 <= V.E.str2
 #MSG ["%sis less than or equal to%s!", V.E.str1,V.E.str2]
$ENDIF
(-> Result is "Peter is less than or equal to
Peter!")
V.E.str1 = "Bob"
V.E.str2 = "Tim"
$IF V.E.str1 < V.E.str2
 #MSG ["%s is less than %s!", V.E.str1, V.E.str2]
$ELSEIF V.E.str1 <= V.E.str2
 #MSG ["%sis less than or equal to%s!", V.E.str1,V.E.str2]
$ENDIF
(-> Result is "Bob is less than Tim!")

<

<=

Conversion functions:

Integer to String

INT_TO_STR[...]

V.E.str = INT_TO_STR[123]

Real64 to String

REAL_TO_STR[...]

V.E.str = REAL_TO_STR[12.34]

String to Integer

STR_TO_INT[...]

V.E.sgn32 = STR_TO_INT["12"]

String to Real64

STR_TO_REAL[...]

V.E.real64 =
STR_TO_REAL["123.45"]