question: public static String subString ( String string , int beginIndex , int length ) { if ( string == null ) { return null ; } final int endIndex = beginIndex + length ; if ( beginIndex >= string . length ( ) ) { return EMPTY ; } if ( endIndex > string . length ( ) ) { return string . substring ( beginIndex , string . length ( ) ) ; } return string . substring ( beginIndex , endIndex ) ; }
target:  Gets the sub string of the given string. If the beginIndex is larger than the length of the string, the empty string is returned. If the beginIndex + the length is larger than the length of the string, the part of the string following the beginIndex is returned. Method is out-of-range safe.