processing shorten string code example Example: processing shorten string str1 = str1.substring(0, 2);