public static String[] removeCharacters(String[] arr){
String[] str = new String[arr.length];
for (int i = 0; i <arr.length; i++) {
if(Character.isLetter(arr[i].charAt(i)))
str[i] += arr[i].charAt(i);
else
str[i] = "";
}
return str;
}
I'm trying to write a method that returns to String array and takes an String array argument. I need remove special characters from the element and return the element without specials.
- For example; ["Hel123&$$o", "#$%World", "###"] will return to
- ["Hello", "World", "",] as a output.
- I also converted back to String, remove those special characters and split back again to an Array but when i convert to String it all comes together and there is no split point and I don't want to do it with Regex so i'm trying to do without it. With my solution I'm getting null so i couldn't fix.