123456789101112131415161718192021 |
- public class StringUtilities {
- public Character getMiddleCharacter(String word){
- int newWord = word.length();
- if (newWord % 2 == 0) {
- return word.charAt((newWord/2) -1);
- }else{
- return word.charAt((newWord-1)/2);
- }
- }
-
- public String removeCharacter(String value, char charToRemove){
- return null;
- }
-
- public String getLastWord(String value) {
- String newWord = value.substring(value.lastIndexOf(' '),value.length());
- return newWord;
-
- }
- }
|