Try using positive look-behind, a regex construct that does not capture its input:
String s = "A#B^C&D!ased&acdf@Mhj%";
String temp[] = s.split("(?<=[#^&!@%]+)");
The (?<=expr)
construct matches at the point right after expr
, without capturing the expr
itself, letting you split the text at positions that follow the separator.
Here is a demo on ideone.