public static String removeCharsFromString ( String inputStr , int start , int end ) { StringBuilder sb = new StringBuilder ( inputStr ) ; sb . delete ( start , end ) ; // if ((start > 0) && (inputStr.charAt(start - 1) ==' ')) { // // if end with a space, then remove it as well. // sb.deleteCharAt(start - 1); // } return sb . toString ( ) ; }
Removes the chars from string .