Skip to content

Instantly share code, notes, and snippets.

@msalvadores
Created December 13, 2011 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msalvadores/1473419 to your computer and use it in GitHub Desktop.
Save msalvadores/1473419 to your computer and use it in GitHub Desktop.
fast filtered output test
package test;
import java.io.PrintStream;
public class TestOutput {
public static void outputFiltered(String label, PrintStream out) {
for (byte b : label.getBytes()) {
if (Character.isLetterOrDigit((char)b)) {
out.print((char)b);
}
}
}
public static void main(String[] args) {
String label = "abcd. 12345 !@#$ abcd";
outputFiltered(label,System.out);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment