A general solution using just Java SE APIs is:
String separator = ...
s.split(Pattern.quote(separator));
The quote method returns a regex that will match the argument string as a literal.
A general solution using just Java SE APIs is:
String separator = ...
s.split(Pattern.quote(separator));
The quote method returns a regex that will match the argument string as a literal.