StringUtilities.java 485B

1234567891011121314151617181920
  1. import java.util.*;
  2. public class StringUtilities {
  3. public Character getMiddleCharacter(String word){
  4. return word.charAt((word.length() - 1)/2);
  5. }
  6. public String removeCharacter(String value, char charToRemove){
  7. String a = value.substring(0, value.length() - 1);
  8. return a;
  9. // return value.substring(0, value.length() -1);
  10. }
  11. public String getLastWord(String value) {
  12. return value.substring(value.lastIndexOf(" ") +1) ;
  13. }
  14. }