Strings shouldn't really just be trimmed. The user should get an error if the string is too long (if you use exceptions this would be easy to throw an exception here and catch it to display as a nice user error).