mid PowerHome formula function
Description
Obtains a specified number of characters from a specified (interior) position in a string.
Syntax
mid ( string, start, length )
Argument Description
string String from which you want characters returned
start Number. A long specifying the position of the first character you want returned (the position of the first character of the string is 1)
length (optional) Number. A long whose value is the number of characters you want returned. If you do not enter length or if length is greater than the number of characters to the right of start, Mid returns the remaining characters in the string
Return value
String. Returns characters specified in length of string starting at character start. If start is greater than the number of characters in string, the Mid function returns the empty string (""). If length is greater than the number of characters remaining after the start character, Mid returns the remaining characters. The return string is not filled with spaces to make it the specified length.
Examples
The following examples demonstrate typical syntax/ usage for this function.
• mid ( "[TEMP4]", 2,4)
• if( mid( "[LOCAL1]", 6, 12 ) = "HTTP/1.1 404", "ERROR", "Nextline")