StringUtilities.java 479B

1234567891011121314151617
  1. public class StringUtilities {
  2. public Character getMiddleCharacter(String word){
  3. char midLetter;
  4. return midLetter = word.charAt(word.length() / 2);
  5. }
  6. public String removeCharacter(String value, char charToRemove){
  7. String result = value.replace(Character.toString(charToRemove), "");
  8. return result;
  9. }
  10. public String getLastWord(String value) {
  11. return value.substring(value.lastIndexOf(" ")+1);
  12. }
  13. }