我想在VB.NET中使用Split
函数拆分一个字符串,但我真的需要将这个字符串拆分为多个分隔符:“+”,“ - ”,“*”,“%”和“/".
这是我的代码:
' the print variable is the input string
Dim calcule As String = print
''
Dim Tableau() As String, i As Long
Tableau = Split(calcule, "+")
For i = LBound(Tableau) To UBound(Tableau)
If var_i.Contains(Tableau(i)) Then
Dim adrs As Integer = Array.FindIndex(var_i, Function(s) s = Tableau(i))
calcule = calcule.Replace(var_i(adrs), var(adrs))
End If
Next
''
Dim result = New DataTable().Compute(calcule, Nothing)
这是我想改变的第四行。你有没有为我找到解决方案?