Basically this line of code does not work and I’m not quite sure as to why:
String[] stringHolder = string.split("_(B");
I get this error: Unclosed group near index 3
This line of code works however:
String[] stringHolder = string.split("_B");
So this leads me to believe that it’s caused by the “(“. Can anyone tell me how to make this work?
The
(is a special character in regex, you need to escape it with a\. And since\needs to be escaped inside a string literal, you add two:More info: Use Round Brackets for Grouping