I need to test whether character is a letter or a space before moving on further with processing. So, i
for (Character c : take.toCharArray()) {
if (!(Character.isLetter(c) || Character.isSpaceChar(c)))
continue;
data.append(c);
Once i examined the data, i saw that it contains characters which look like a unicode representation of characters from outside of Latin alphabet. How can i modify the above code to tighten my conditions to only accept letter characters which fall in range of [a-z][A-Z]?
Is Regex a way to go, or there is a better (faster) way?
If you just want to strip out non-ASCII letter characters, then a quick approach is to use
String.replaceAll()and Regex:Can’t say anything about performance vs. a character by character scan and append to
StringBuilder, though.