123456789101112131415161718192021 |
- public class StringUtilities {
- public Character getMiddleCharacter(String word){
- return word.charAt((word.length()) / 2);
- }
-
- public String removeCharacter(String value, char charToRemove){
-
- String r = "";
- for (int i = 0; i < value.length(); i++) {
- if (value.charAt(i) != charToRemove) r += value.charAt(i);
- }
- return r;
-
- }
-
- public String getLastWord(String value) {
- String lastWord = value.substring(value.lastIndexOf(" ")+1);
- return lastWord;
- }
- }
|