StringUtilities.java 549B

1234567891011121314151617181920212223242526
  1. //import java.utils.*;
  2. public class StringUtilities {
  3. public Character getMiddleCharacter(String word){
  4. return word.charAt(word.length()/2);
  5. }
  6. public String removeCharacter(String value, char charToRemove){
  7. String s="";
  8. s=s+charToRemove;
  9. String str="";
  10. str =str+value.replace(s,"");
  11. return str;
  12. }
  13. public String getLastWord(String value) {
  14. //int n=value.length();
  15. String str=value.substring(value.lastIndexOf(" ")+1);
  16. return str;
  17. }
  18. }