Hi
I have a string variable..
"LongDate;;", if I pass it to StrParse, which is just a RegEx.Split function, it returns a string array with a length of 1, however
"LongDate; ; ", returns a string array with length 3.
e.g. Dim spFormats() As String = StrParse(";", "LongDate;;")
I have a string variable..
"LongDate;;", if I pass it to StrParse, which is just a RegEx.Split function, it returns a string array with a length of 1, however
"LongDate; ; ", returns a string array with length 3.
e.g. Dim spFormats() As String = StrParse(";", "LongDate;;")
B4X:
Sub FixDelimiter(sValue As String) As String
If sValue = "|" Then sValue = "\|"
If sValue = "." Then sValue = "\."
If sValue = "\" Then sValue = "\\"
If sValue = "^" Then sValue = "\^"
If sValue = "$" Then sValue = "\$"
If sValue = "?" Then sValue = "\?"
If sValue = "*" Then sValue = "\*"
If sValue = "+" Then sValue = "\+"
If sValue = "(" Then sValue = "\("
If sValue = ")" Then sValue = "\)"
If sValue = "[" Then sValue = "\["
If sValue = "{" Then sValue = "\{"
If sValue = ";" Then sValue = "\;"
Return sValue
End Sub
B4X:
Sub StrParse(Delimiter As String, MV As String) As String()
Delimiter = FixDelimiter(Delimiter)
Return Regex.Split(Delimiter, MV)
End Sub