Syntax
| Word$(text$,first[,last])
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Description
| Returns a String containing a single word or sequence of words between first and last.
Words are separated by any nonalphanumeric characters such as spaces, tabs, end-of-lines, and punctuation.
If first is greater than the number of words in text$, then a zero-length string is returned.
If last is greater than the number of words in text$, then all words from first to the end of the text are returned.
| ||||||||
See Also
| |||||||||
Example
| Sub Main
‘This example finds the name “Stuart” in a string
‘and then extracts two words from the string.
s$ = “My last name is Williams; “ & _
“Stuart is my surname.”
c$ = Word$(s$,5,6)
MsgBox “The extracted name is: “ & c$
End Sub
|