The trim() method of String values removes whitespace from both ends of this string and returns a new string, without modifying the original string. To return a new string with whitespace trimmed from just one end, use trimStart() or trimEnd().
If you trim something, for example, someone's hair, you cut off small amounts of it in order to make it look neater and tidier. Discover everything about the word "TRIM" in English: meanings, translations, synonyms, pronunciations, examples, and grammar insights - all in one comprehensive guide.
Definition of trim verb in Oxford Advanced Learner's Dictionary. Meaning, pronunciation, picture, example sentences, grammar, usage notes, synonyms and more.