target.SplitString
Description
Breaks an input string into an array of words. Any character which is not a letter, underscore, or a digit is considered to be a word separator.
Syntax
Function SplitString(text)
Parameters
string text - input text
Return value
one dimensional array - will contain all of the words in the input text
Example
Sample code
Function IsName( s, ByRef v1, ByRef v2, ByRef v3 )
Dim w, n, l, c
w = Target.SplitString(s)
n = UBound(w)
IsName = 0
l = Len(w(0))
If Mid(s, l+1,2)=", " Or Mid(s, l+1,2)=". "Then
If n = 1 Then
IsName = 1
v2 = w(1)
ElseIf n > 1 Then
If Len(w(2)) < 3 Then IsName = 1
If n > 2 Then
For i = 3 To n: c = c & " " & w(i): Next
v3 = Trim(c)
End If
v2 = w(1) & " " & w(2)
End If
v1 = Left(s, l)
End If
End Function
See also