Remove all non alphabetic characters from a String array in java

后端 未结 8 920
难免孤独
难免孤独 2020-12-14 08:11

I\'m trying to write a method that removes all non alphabetic characters from a Java String[] and then convert the String to an lower case string. I\'ve tried u

8条回答
  •  失恋的感觉
    2020-12-14 08:50

    You can also use Arrays.setAll for this:

    Arrays.setAll(array, i -> array[i].replaceAll("[^a-zA-Z]", "").toLowerCase());
    

提交回复
热议问题