public String extract ( int start , int end ) { if ( ( start < 0 ) || ( start >= end ) || ( end > length ) ) return ( "" ) ; else return ( string . substring ( start , end ) ) ; }
Extract and return a substring that starts at the specified position and ends at the character before the specified position . If this is not possible a zero - length string is returned .