MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › trim
String.prototype.trim() - JavaScript - MDN Web Docs
The trim() method of String values removes whitespace from both ends of this string and returns a new string, without modifying the original string.
W3Schools
w3schools.com › jsref › jsref_trim_string.asp
JavaScript String trim() Method
The trim() method removes whitespace from both sides of a string.
This is Trim. Hailing from South Carolina, she's barely been ...
03:48
Trim - CHRÖME (ft. slayr) [Official Music Video] - YouTube
Trim: On Her Breakout Year, Her Character, and ...
01:38
Trim - Taxi (Official Music Video) - YouTube
02:48
Trim - Nobody (Remix) (feat. Monaleo) (Official Music Video) - YouTube
04:00
Trim "BOAT" | On The Radar Performance - YouTube
Processing
processing.org › reference › trim_.html
trim() / Reference / Processing.org
String s1 = " Somerville MA "; println(s1); // Prints " Somerville MA " String s2 = trim(s1); println(s2); // Prints "Somerville MA" String[] a1 = { " inconsistent ", " spacing" }; // Note spaces String[] a2 = trim(a1); printArray(a2); // Prints the following array contents to the console: // [0] "inconsistent" // [1] "spacing" trim(str) trim(array) str(String)any string ·
PHP
php.net › manual › en › function.trim.php
PHP: trim - Manual
<?php $text = "\t\tThese are a few words :) ... "; $binary = "\x09Example string\x0A"; $hello = "Hello World"; var_dump($text, $binary, $hello); print "\n"; $trimmed = trim($text); var_dump($trimmed); $trimmed = trim($text, " \t."); var_dump($trimmed); $trimmed = trim($hello, "Hdle"); var_dump($trimmed); $trimmed = trim($hello, 'HdWr'); var_dump($trimmed); // trim the ASCII control characters at the beginning and end of $binary // (from 0 to 31 inclusive) $clean = trim($binary, "\x00..\x1F"); var_dump($clean); ?>
Microsoft Support
support.microsoft.com › en-us › excel › functions › trim-function
TRIM function | Microsoft Support
The TRIM function removes all spaces from text except for single spaces between words. Use TRIM on text that you have received from another application that may have irregular spacing.
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-string-trim-method
JavaScript String trim() Method - GeeksforGeeks
The trim() method is used to remove extra spaces from a string.
Published January 16, 2026
Wikipedia
en.wikipedia.org › wiki › Trim_(computing)
Trim (computing) - Wikipedia
1 month ago - A trim command (known as TRIM in the ATA command set, and UNMAP in the SCSI command set) allows an operating system to inform a storage medium which blocks of data are no longer considered to be "in use" and therefore can be erased internally. TRIM is primarily used on solid-state drives (SSDs), ...
Google Play
play.google.com › store › apps › details
TRIM - Apps on Google Play
April 28, 2026 - - A store where you will find all you need of cosmetics of all kinds Bookings classification page: New, Confirmed, Expired, . Personal page: , favorites, settings, alerts, account modification, . Download Trim, register, and book.. All the steps are completely free without any subscriptions and also pay cash in the salon.
Florida Department of Revenue
floridarevenue.com › property › Pages › TRIM.aspx
Florida Dept. of Revenue - Property Tax - T.R.I.M.
In 1980, the Florida Legislature passed the Truth in Millage (TRIM) Act. This law is designed to inform taxpayers which governmental entity is responsible for the taxes levied and the amount of tax liability taxpayers owe to each taxing authority.
Google Support
support.google.com › docs › answer › 3094140
TRIM function - Google Docs Editors Help
Removes leading, trailing, and repeated spaces in text. Sample Usage TRIM(" lorem ipsum") TRIM(A2) Syntax TRIM(text) text - The string or reference to a cell containing a string to be t
Merriam-Webster
merriam-webster.com › dictionary › trim
TRIM Definition & Meaning - Merriam-Webster
1 week ago - The meaning of TRIM is to remove by or as if by cutting. How to use trim in a sentence.
Cambridge Dictionary
dictionary.cambridge.org › us › dictionary › english › trim
TRIM | definition in the Cambridge English Dictionary
TRIM meaning: 1. to make something tidier or more level by cutting a small amount off it: 2. to reduce the…. Learn more.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › trimEnd
String.prototype.trimEnd() - JavaScript - MDN Web Docs
July 10, 2025 - The trimEnd() method of String values removes whitespace from the end of this string and returns a new string, without modifying the original string.
AZEK Exteriors
azekexteriors.com › products › trim
Trim | AZEK Exteriors
With over 20 profiles available in various finishes, our product offering goes well beyond the basics. We engineer a wide variety of solution-based profiles to address specific installation challenges. Add efficiency to your next project with AZEK Trim options.
Top answer 1 of 14
2017
To remove all whitespace surrounding a string, use .strip(). Examples:
>>> ' Hello '.strip()
'Hello'
>>> ' Hello'.strip()
'Hello'
>>> 'Bob has a cat'.strip()
'Bob has a cat'
>>> ' Hello '.strip() # ALL consecutive spaces at both ends removed
'Hello'
Note that str.strip() removes all whitespace characters, including tabs and newlines. To remove only spaces, specify the specific character to remove as an argument to strip:
>>> " Hello\n ".strip(" ")
'Hello\n'
To remove only one space at most:
def strip_one_space(s):
if s.endswith(" "): s = s[:-1]
if s.startswith(" "): s = s[1:]
return s
>>> strip_one_space(" Hello ")
' Hello'
2 of 14
285
As pointed out in answers above
my_string.strip()
will remove all the leading and trailing whitespace characters such as \n, \r, \t, \f, space .
For more flexibility use the following
- Removes only leading whitespace chars:
my_string.lstrip() - Removes only trailing whitespace chars:
my_string.rstrip() - Removes specific whitespace chars:
my_string.strip('\n')ormy_string.lstrip('\n\r')ormy_string.rstrip('\n\t')and so on.
More details are available in the docs.
Wikipedia
en.wikipedia.org › wiki › Trim_(American_rapper)
Trim (American rapper) - Wikipedia
1 day ago - Ahlaisha Kornickey, known professionally as Trim, is an American rapper. She is best known for her 2025 single "Boat" (remixed featuring YKNiece and BunnaB or Pooh Shiesty), which entered the Hot R&B/Hip-Hop Songs chart. Ahlaisha Kornickey was raised in Charleston, South Carolina.