@@ -0,0 +1,563 @@
+package com.levelup.java.regex;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport org.junit.Test;%0A%0A/**%0A * This java example will demonstrate how to remove all chars from string.%0A * %0A * @author Justin Musgrove%0A * @see %3Ca href=%0A *      'http://www.leveluplunch.com/java/examples/remove-char-from-string-regex/'%3EReg%0A *      e x to remove everything but numbers%3C/a%3E%0A */%0Apublic class RemoveAllCharsFromString %7B%0A%0A%09@Test%0A%09public void remove_chars_string() %7B%0A%0A%09%09String digits = %221a2b3c%22.replaceAll(%22%5B%5E%5C%5Cd%5D%22, %22%22);%0A%0A%09%09assertEquals(123, Integer.parseInt(digits));%0A%09%7D%0A%0A%7D%0A

remove all chars from strings