Skip to content

Instantly share code, notes, and snippets.

@nyer
Created July 17, 2015 11:49
Show Gist options
  • Select an option

  • Save nyer/0ef16f56b286bb0e9d22 to your computer and use it in GitHub Desktop.

Select an option

Save nyer/0ef16f56b286bb0e9d22 to your computer and use it in GitHub Desktop.
import java.util.regex.Pattern;
import java.util.Arrays;
public class UnprintCharSplit {
public static void main(String[] args) {
char ch = (char) 0x01;
StringBuilder buf = new StringBuilder();
buf.append("a");
buf.append(ch);
buf.append("b");
String str = buf.toString();
String[] parts = str.split(Character.toString(ch));
System.out.println(Arrays.toString(parts));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment