+ 3
Do you want to git rid all characters of a given type? I.E remove all instances of the lower case letter 'g' from a given string. Just one at an index? all but the first/last? There are multiple ways of doing this but the answer may depend more on what you're want to do exactly. For instance, to remove/replace all the lowercase letter g from the string "aaaabbbtttddddgggwwwSSKK", you can use the replaceAll() method of the string object/literal and pass in the String "g" and an empty String "". String s = "aaaabbbtttddddgggwwwSSKK"; s = s.replaceAll("g", ""); System.out.println(s);
1st Nov 2017, 4:02 AM
ChaoticDawg
ChaoticDawg - avatar