I have a string in my Java program which is read from database.
This may contain special characters in between as below:
Try the regex,
String result= yourString.replaceAll("[^a-zA-Z0-9]+","");
That gives you the result with only Alpha Numeric.
result
If you want only Alphabets
String resultWithAlphabetsOnly= yourString.replaceAll("[^a-zA-Z]+","");