the
mid
of
(
string ,
offset ,
length )
mid
(
string ,
offset ,
length )
String yields any string
. Offset and length yield integer
s.
The mid
function returns length characters of the specified string starting at the specified offset. The first character of the string is at offset 1.
If no length is specified, all characters of the string starting at the specified offset are returned.
If length is zero or negative, or offset is greater than the length of the string, empty
is returned. If offset is zero or negative, the leftmost length+offset-1 characters of the string are returned.