0

I would like to split a string with the Split function in VB.NET, but I really need to split this string with many separator: "+", "-" ,"*", "%" and "/".

Here is my code :

' 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)

This is the fourth line I would like to change. Haven't you got a solution for me?

0 Answers0