Let\'s say have a string...
String myString = \"my*big*string*needs*parsing\";
All I want is to get an split the string into \"my\" , \"bi
One escape \
will not do the trick in Java 6 on Mac OSX, as \
is reserved for \b \t \n \f \r \'\"
and \\
. What you have seems to work for me:
public static void main(String[] args) {
String myString = "my*big*string*needs*parsing";
String[] a = myString.split("\\*");
for (String b : a) {
System.out.println(b);
}
}
outputs:
my
big
string
needs
parsing