I am trying to get a sentence using input from the user in Java, and i need to make it lowercase and remove all punctuation. Here is my code:
String[] wo
I don't like to use regex, so here is another simple solution.
public String removePunctuations(String s) { String res = ""; for (Character c : s.toCharArray()) { if(Character.isLetterOrDigit(c)) res += c; } return res; }
Note: This will include both Letters and Digits