Skip to content

@jrajav /gist:4012570
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
class Main
{
public static void main(String[] args) throws Exception
{
byte[] buffer = {0x53, 0x6f, 0x08, 0x6e, 0x69, 0x01, 0x63}; // 'S', 'o', '^?' (Backspace), 'n', 'i', '^A' (SOH), 'c'
String str = new String(buffer, "US-ASCII");
System.out.println("String: " + str);
System.out.println("Trimmed string: " + str.replaceAll("[^\\p{Print}]",""));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.