6.3.36 STRING functions
Overview
The following functions enable strings to be processed:
● Determine length of string
● Find a character in a string
● Extract substring from left
● Extract substring from right
● Extract substring from mid-string
● Replace substring
● Compare strings
● Insert a string in another string
● Remove a string from a string
● Remove spaces (from left or from the right)
● Insert values or strings with formatting identifiers
LEN function: Length of a string
Syntax: LEN
(string | varname)
Description: Determines the number of characters in a string
Parameters: string Every valid string expression. NULL is output if string is
empty.
varname Any valid declared variable name
Only one of the two parameters is allowed.
Example
DEF VAR01
DEF VAR02
LOAD
VAR01="HALLO"
VAR02=LEN(VAR01) ; Result = 5
END_LOAD
INSTR function: Search for character in string
Syntax: INSTR
(Start, String1, String2 [,Direction])
Description: Searches for characters
Programming commands
6.3 Functions
SINUMERIK Integrate Run MyScreens (BE2)
182 Programming Manual, 12/2017, 6FC5397-1DP40-6BA1