split string c# based on math operator
问题 (Calculator program)count in one step with math basic order if there is a string = "5+2*6/9"(which is user input) how to get number 2 and 6? i've been trying with split but if there is no '+' it fail :( here is my code atm string[] a = kalimat.Split('*'); string[] a1 = a[0].Split('+'); string[] a2 = a1[a1.Count() - 1].Split('-'); string[] b1 = a[1].Split('+'); string[] b2 = b1[0].Split('-'); ang1 = a2[a2.Count() - 1]; ang2 = b2[0]; angka1 = Convert.ToDouble(ang1); angka2 = Convert.ToDouble