These functions are used for retrieval of special strings and for string operations. The string retrieval functions ("get...") can be used in text fields as well.
Note that these functions do not change their arguments, but give their result as return value. For instance, a command
stringLower (s);
will not change s anyway. To modify s, you have to write
s := stringLower (s)
which writes the result of "stringLower (s)" back to the variable s.
Name |
Purpose |
Arguments |
Return value |
Example |
PrintToString |
stores the result of a print command to a string |
several arguments, same syntax as the command "print" |
STRING |
s:=printToString ("DSP.MEASM = ", DSP.MEASM); |
StringCharAt
|
retrieves the character of a string at a specified position |
1: STRING: string to be edited 2: INTEGER: Position (starting with 1) |
CHAR |
c2:=stringCharAt (s, 2); |
StringComp
|
compares two strings under consideration of capital and small letters |
1: STRING: |
INTEGER: -1 if string 1 is lexically before string 2, 1 if string 1 is lexically after string 2 |
i:=stringComp ("abc","ABC"); |
StringCompNoCase
|
compares two strings without considering the capital and small letters |
1: STRING: |
INTEGER: -1 if string 1 is lexically before string 2, 1 if string 1 is lexically after string 2 |
i:=stringCompNoCase ("abc", "ABC"); |
StringDelete
|
Deletes specific characters from a string |
1: STRING: string to be edited 2: INTEGER: Position (starting with 1) 3: INTEGER (optional): Number of characters to be deleted (default is 1) |
STRING: modified string |
s:=stringDelete ("ABC", 2); |
StringFind
|
Finds a sub-string in a larger string |
1: STRING: string to be edited 2: STRING: sub-string to be searched 3: INTEGER (optional): Start position for the search (default is 1) |
INTEGER: Position, at which the sub-string starts (starting with 1), 0 if the sub-string is not found |
i:=stringFind ("ABC", "C"); |
StringFindOneOf
|
Finds the first matching character of a set |
1: STRING: string to be edited 2: STRING: set of characters to be searched |
INTEGER: Position of the first occurrence of a character from the character set, 0 if the string does nit contain any character from the set |
i:=stringFindOneOf ("ABC", "HFB"); |
StringInsert
|
insert a sub-string at a given position within the string |
1: STRING: string to be edited 2: INTEGER: Position, at which the sub-string is inserted (starting with 1) 3: STRING: sub-string to insert into string |
STRING: modified string |
s:=stringInsert ("ABC", 1, "XY"); gives “XYABC” |
StringLeft
|
extracts the left part of a string |
1: STRING: string to be edited 2: INTEGER: Number of characters to be extracted |
STRING: extracted string |
s:=stringLeft ("ABC", 2); |
StringLen
|
returns the length of a string |
1: STRING: string to be edited |
INTEGER: Length of the string (0 for an empty string) |
i:=stringLen ("ABCDEF"); |
StringLower
|
Converts a string in lower case letters (includes German umlauts) |
1: STRING: string to be edited |
STRING: modified string |
s:=stringLower ("ABC"); |
StringMid
|
Extracts a specified part of a string |
1: STRING: string to be edited 2: INTEGER: Position, at which the extraction is to start (starting with 1) 3: INTEGER (optional): Number of characters to be extracted, if –1, the remainder of the string is extracted (default) |
STRING: extracted string |
s:=stringMid ("ABCDEF", 4); |
StringReplace
|
replaces indicated characters of the string with the specified characters |
1: STRING: string to be edited 2: STRING: string to be replaced 3: STRING: string to be used for replacement |
STRING: modified string |
s:=stringReplace ("ABCABC", "B", "XY"); |
StringReverse
|
reverses the sequence of the characters in the string. |
1: STRING: string to be edited |
STRING: reversed string |
s:=stringReverse ("ABC"); |
StringRight
|
extracts the right part of a string |
1: STRING: string to be edited 2: INTEGER: Number of characters to be extracted |
STRING: extracted string |
s:=stringRight ("ABC", 2); |
StringSpanExcluding
|
extracts a subset that contains only the characters not in a set |
1: STRING: string to be edited 2: STRING: set of the characters that indicate the end of extraction |
STRING: extracted string |
s:=stringSpanExcluding ("ABC.DEF", ".,;" ); |
StringSpanIncluding
|
extracts a subset that contains only the characters in a set |
1: STRING: string to be edited 2: STRING: set of the characters that are allowed in the extracted string |
STRING: extracted string |
s:=stringSpanIncluding ("45;48;52", "0123456789" ); |
StringTrim |
trims leading and trailing white space characters from a string |
1: STRING: string to be edited |
STRING: modified string |
s:=stringTrim(" ABC "); |
StringTrimLeft |
trims leading white space characters from a string |
1: STRING: string to be edited |
STRING: modified string
|
s:=stringTrimLeft(" ABC "); |
StringTrimRight
|
trims trailing white space characters from a string |
1: STRING: string to be edited |
STRING: modified string
|
s:=stringTrimRight(" ABC "); |
StringUpper
|
Converts a string in upper case characters (including German umlauts, but ß remains unchanged) |
1: STRING: string to be edited |
STRING: modified string
|
s:=stringUpper("abc"); |