A ansoUzr Member Licensed User Longtime User Aug 5, 2016 #1 I have a string s = "a,,,". If I use ... SF.Split(s,",") the length of the returned list is 2. If I change to "s= a, , ," the returned length is 3. I would have thought both would have returned a length of 4. Am I missing something? (For comparison: Visual Basic Split Function returns 4.) William
I have a string s = "a,,,". If I use ... SF.Split(s,",") the length of the returned list is 2. If I change to "s= a, , ," the returned length is 3. I would have thought both would have returned a length of 4. Am I missing something? (For comparison: Visual Basic Split Function returns 4.) William
Erel B4X founder Staff member Licensed User Longtime User Aug 5, 2016 #2 Trailing empty matches are removed (see the documentation). Code: Copy Dim s() As String = Regex.Split(",","a,,,") '1 Log(s.Length) Dim s() As String = Regex.Split(",","a,,, ") '4 Log(s.Length) Upvote 0
Trailing empty matches are removed (see the documentation). Code: Copy Dim s() As String = Regex.Split(",","a,,,") '1 Log(s.Length) Dim s() As String = Regex.Split(",","a,,, ") '4 Log(s.Length)
A ansoUzr Member Licensed User Longtime User Aug 5, 2016 #3 Thanks. I should have caught that. Erel said: Trailing empty matches are removed (see the documentation). Code: Copy Dim s() As String = Regex.Split(",","a,,,") '1 Log(s.Length) Dim s() As String = Regex.Split(",","a,,, ") '4 Log(s.Length) Click to expand... Upvote 0
Thanks. I should have caught that. Erel said: Trailing empty matches are removed (see the documentation). Code: Copy Dim s() As String = Regex.Split(",","a,,,") '1 Log(s.Length) Dim s() As String = Regex.Split(",","a,,, ") '4 Log(s.Length) Click to expand...