StringMid() Function
- Last UpdatedFeb 21, 2017
- 1 minute read
Returns a part of a string. You can specify the starting point and how many characters to return.
Syntax
result = StringMid (string, startpos, length)
Parameters
string
A literal text, message tagname, or string expression.
startpos
The starting position in the string. A literal number, analog tagname, or numeric expression.
length
The number of characters to return. A literal number, analog tagname, or numeric expression.
Example(s)
StringMid("Hello World",5,4) returns "o Wo".
StringMid("Hello World",7,50) returns "World".
StringMid("Hello World",4,0) returns "lo World".
Note: If you pass 0 as length to the StringMid() function, it returns the entire string after the starting position.