StringUtilities.java 458B

123456789101112131415161718
  1. public class StringUtilities {
  2. public Character getMiddleCharacter(String word){
  3. return word.charAt((word.length()-1)/2);
  4. }
  5. public String removeCharacter(String value, char charToRemove){
  6. return null;//value.removeCharAt(value,charToRemove);
  7. }
  8. public String getLastWord(String value) {
  9. //return (value + " ").split(" ")[i-1];
  10. return value.substring(value.lastIndexOf(" ")+1);
  11. }
  12. }