123456789101112131415161718192021
  1. public class StringUtilities {
  2. public Character getMiddleCharacter(String word){
  3. int newWord = word.length();
  4. if (newWord % 2 == 0) {
  5. return word.charAt((newWord/2) -1);
  6. }else{
  7. return word.charAt((newWord-1)/2);
  8. }
  9. }
  10. public String removeCharacter(String value, char charToRemove){
  11. return null;
  12. }
  13. public String getLastWord(String value) {
  14. String newWord = value.substring(value.lastIndexOf(' '),value.length());
  15. return newWord;
  16. }
  17. }