- Home
·
- String Manipulation
·
- A function which Returns a zero-based, one-dimensionalarray containing a specified number of substr
A function which Returns a zero-based, one-dimensionalarray containing a specified number of substr
A function which Returns a zero-based, one-dimensionalarray containing a specified number of substrings .Please ignor if any error occurs this
API Declarations
'Use Like this
'u can use any separator , . @ etc.
dim StrTemp
StrTemp=GetWord(Text1.text,",")
Rate A function which Returns a zero-based, one-dimensionalarray containing a specified number of substr
(2(2 Vote))
On Error GoTo GetWord_error
Dim P, S, L, I As Integer
Dim Temp1 As String
Dim GetWords() As String
Temp1 = Replace(strText, Separator, "")
S = (Len(strText) - Len(Temp1)) / Len(Separator)
S = S
ReDim GetWords(S)
If S > 0 Then
L = Len(strText)
For I = 0 To S
P = InStr(strText, Separator)
If P = 0 Then
GetWords(I) = strText
Exit For
Else
GetWords(I) = Mid(strText, 1, P - 1)
strText = Mid(strText, P + 1, L)
L = Len(strText)
End If
Next
Else
GetWords(S) = strText
End If
GetWord = GetWords
Exit Function
GetWord_error:
GetWord = ""
Exit Function
End Function
A function which Returns a zero-based, one-dimensionalarray containing a specified number of substr Comments
No comments yet — be the first to post one!
Post a Comment