B4X
B4X
StringTable SplitAndAppend Example
Demonstrates the StringTable SplitAndAppend method.Chilkat B4X Downloads
Dim strTab As ChilkatStringTable
strTab.Initialize
' SplitAndAppend make it easy to break apart comma delimited, semicolon delimited,
' or strings delimited by other characters.
Dim s As String = "abc,123,xyz,456,music,math," & Chr(34) & "World History" & Chr(34) & "," & Chr(34) & "Chicago,Cubs" & Chr(34) & ",Japan"
strTab.SplitAndAppend(s, ",", True, True)
Dim i As Int = 0
Dim numStrings As Int = strTab.Count
Do While i < numStrings
Log(i & ": " & strTab.StringAt(i))
i = i + 1
Loop
' The output is:
' 0: abc
' 1: 123
' 2: xyz
' 3: 456
' 4: music
' 5: math
' 6: "World History"
' 7: "Chicago,Cubs"
' 8: Japan
' Note: Keeping the quotes is intentional.