History |
Mid (strings)
Purpose
Returns a substring from within a string expression.
Syntax
Mid (StringExpression, StartOffset [, Length])
Example
Sub Main()
Dim s As String
Dim loc As Integer, loc2 As Integer
s = "the quick fox runs fast"
loc = InStr(1, s, " ")
loc2 = InStr(loc + 1, s, " ")
Print "token:"; Mid(s, loc + 1, loc2 - loc - 1);" ' "
End Sub
| ||||||||