Possible Duplicate:
up to first N characters
I need to “trim” my variable called: “TITLE” to only 40 characters
Java: Limiting/Trim/ Removing extra characters from string. I want to remove any extra characters after 40 characters of a string variable.