MCPcopy Index your code
hub / github.com/careercup/ctci / clean

Method clean

java/Chapter 17/Question17_14/Question.java:95–101  ·  view source on GitHub ↗
(String str)

Source from the content-addressed store, hash-verified

93 }
94
95 public static String clean(String str) {
96 char[] punctuation = {',', '"', '!', '.', '\'', '?', ','};
97 for (char c : punctuation) {
98 str = str.replace(c, ' ');
99 }
100 return str.replace(" ", "").toLowerCase();
101 }
102
103 public static void main(String[] args) {
104 dictionary = AssortedMethods.getTrieDictionary();

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected