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