例如,这有效:
String test = "I am a good boy";
String splitbyWord = "a good";
System.out.println(test.split(splitbyWord)[1]); => boy
但这不会:
String test = "I am a (good) boy";
String splitbyWord = "a (good)";
System.out.println(test.split(splitbyWord)[1]);
=>index out of bound
我该如何解决?