Remove specific char from String

M.ArslanKhan picture M.ArslanKhan · Dec 25, 2013 · Viewed 86.1k times · Source

How To remove a specific Character from a String. I have a Arraylist testingarray.

String line=testingarray.get(index).toString();

I want to remove a specific character from line.

I have Array of uniCodes

int uniCode[]={1611,1614,1615,1616,1617,1618};

i want to remove those characters that have these Unicodes.

Answer

Shayan Pourvatan picture Shayan Pourvatan · Dec 25, 2013

use :

NewString = OldString.replaceAll("char", "");

in your Example in comment use:

NewString = OldString.replaceAll("d", "");

for removing Arabic character please see following link

how could i remove arabic punctuation form a String in java

removing characters of a specific unicode range from a string