Difference between revisions of "Mid"

From NSB App Studio
Jump to navigation Jump to search
Line 29: Line 29:

[[Category:Language Reference]]
[[Category:Language Reference]]

Revision as of 18:53, 11 September 2012

Mid(string, start[, length])


Mid returns a string containing characters from the middle of a string. The required parameter, string, is any valid string expression. The required parameter, start, is any valid numeric expression, if start is greater than the length of string, a zero-length string is returned (""). The optional parameter, length, is any valid numeric expression and it specifies the number of characters to return. If length is not used, or exceeds the number of remaining characters in string, all characters from start to the end of string are returned.


Rem Mid Example
'Mid returns substring from string middle
Dim Eric, Mister
Eric = "Cartman"
Print "From Cartman:", Mid(Eric, 2, 3)
Mister = "Hankey"
Print "From Hankey:", Mid(Mister, 4)


From Cartman: art
From Hankey:  key

Related Items

Left, Right