I want to split a string for the character ^
but it does not work. I have the following code:
String numberBase10 = "3.52*10^2";
String[] vector = numberBase10.split("^");
System.out.println("numberBase10: " + numberBase10);
System.out.println("Vector[0]: " vector[0]);
I get the following output:
numberBase10: 3.52*10^2
Vector[0]: 3.52*10^2
And if I try to access vector[1] I get the error IndexOutOfArray.
I have to put any escape character so that split works with ^
?
Thanks