public static String insert(final String str, final String given, final int begin, final int end) {
    if (begin < 1 || end > str.length() || end < begin) { return str; }
    return str.substring(0, begin - 1) + given + str.substring(end);
  }
public static String insert ( final String str , final String given , final int begin , final int end ) { if ( begin < 1 || end > str . length ( ) || end < begin ) { return str ; } return str . substring ( 0 , begin - 1 ) + given + str . substring ( end ) ; }
replace [bigen,end] [1...end] with givenStr
可以使用StringBuilder的replace方法替换该方法

@param str a {@link java.lang.String} object.
@param begin a int.
@param end a int.
@param given a {@link java.lang.String} object.
@return a {@link java.lang.String} object.