Saturday 18 June 2016

Remove special characters(?) from String.

\p{ASCII} is POSIX character classes.It will replace the non ascii string and return the string(Printable ASCII).



String string=givenString.replaceAll("[^\\p{ASCII}]", "");

No comments:

Post a Comment

Find Duplicate Characters In String using Java

package com.zia.test; import java.util.HashMap; import java.util.Map; import java.util.Set; public class findDuplicateCharacter { /**...