Top "Trim" questions

Trimming refers to the manipulation of a text string to remove leading and/or trailing whitespace (and/or ASCII control characters).

JavaScript chop/slice/trim off last character in string

I have a string, 12345.00, and I would like it to return 12345.0. I have looked at trim, but it looks like …

javascript slice trim
Remove all whitespace in a string

I want to eliminate all the whitespace from a string, on both ends, and in between words. I have this …

python trim removing-whitespace
How to trim whitespace from a Bash variable?

I have a shell script with this code: var=`hg st -R "$path"` if [ -n "$var" ]; then echo $var fi …

string bash variables trim
How do I trim whitespace from a string?

How do I remove leading and trailing whitespace from a string in Python? For example: " Hello " --> "Hello" " Hello" …

python string trim
How do I trim whitespace?

Is there a Python function that will trim whitespace (spaces and tabs) from a string? Example: \t example string\t → …

python string whitespace trim strip
Remove all spaces from a string in SQL Server

What is the best way to remove all spaces from a string in SQL Server 2008? LTRIM(RTRIM(' a b …

sql sql-server string whitespace trim
Trim string in JavaScript?

How do I trim a string in JavaScript? That is, how do I remove all whitespace from the beginning and …

javascript string trim
What's the best way to trim std::string?

I'm currently using the following code to right-trim all the std::strings in my programs: std::string s; s.erase(…

c++ trim stdstring
How to Select a substring in Oracle SQL up to a specific character?

Say I have a table column that has results like: ABC_blahblahblah DEFGH_moreblahblahblah IJKLMNOP_moremoremoremore I would like to …

sql oracle substring trim
How do I trim leading/trailing whitespace in a standard way?

Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll …

c string whitespace trim