how would i check a string for special characters such as $%#, and numbers? I only want chars, ex abcd.
the only method i can think of is to make an arraylist of the alphabet and check each index to see if it is in the arraylist.
thanks
RegEx is probably your best bet:
Pattern p = Pattern.compile("[a-zA-Z]");
Matcher m = p.matcher(sourceString);
boolean b = m.matches();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With