question: public static String truncate ( String string , int length ) { if ( string . length ( ) > length ) { string = string . substring ( 0 , length ) ; } return string ; }
target:  Sets the maximum length of the string. Longer strings will be simply truncated.