I need to split string by multiple characters, and store it to multiple variables. i want to split it by "Comma (,)" and "Semicolon (;)"
I am using This Code:
separatedStr() As String
separatedStr = iniValue.Split(Convert.ToChar(","))
For pos As Integer = 0 To separatedStr.Count - 1
Select Case pos
Case 0
Integer.TryParse(separatedStr(pos), tempPhaseBoardNumber)
Case 1
Integer.TryParse(separatedStr(pos), tempChannelNumber)
Case 2
Integer.TryParse(separatedStr(pos), tempAdditionalInfo1)
Case 3
Integer.TryParse(separatedStr(pos), tempAdditionalInfo2)
Case Else
End Select
Next
This code is working in case my string is like this 1,15,20,11 But if in my string Semicolon (;) is coming like 1,15;15,5 then it not working fine. How can i use this code so that it split on basis of both
"Comma" and Simicolon
Splitmethod: String.Split