Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to trim a string without any spaces

Tags:

coldfusion

How do I remove spaces and other whitespace characters from inside a string. I don't want to remove the space just from the ends of the string, but throughout the entire string.

like image 827
soorajthomas Avatar asked Feb 15 '11 13:02

soorajthomas


1 Answers

You can use a regular expression

<cfset str = reReplace(str, "[[:space:]]", "", "ALL") />
like image 58
Sean Coyne Avatar answered Sep 21 '22 18:09

Sean Coyne