12345678910111213141516171819202122232425 |
-
- import java.util.*;
-
- public class StringUtilities {
- public Character getMiddleCharacter(String word)
- {
- return word.charAt(word.length()/2);
-
- }
- public String removeCharacter(String value, char charToRemove)
- {
- String s = "";
- s= s+charToRemove;
- String str ="";
- str=value.replaceAll(s,"");
- return str;
- }
-
- public String getLastWord(String value)
- {
- String str= value.substring(value.lastIndexOf(" ")+1);
- return str;
- }
- }
|