Search
Use the trim() method to remove the trailing spaces from the string stored in the message variable.
trim()
message
For example: