/t5/coldfusion-discussions/function-returning-extra-whitespace/td-p/875530Aug 11, 2008
Aug 11, 2008
Copy link to clipboard
Copied
I created a function to strip all non-numeric characters from
a string and format the phone number in a specific manner, but the
string that is returned has a <space> at the beginning of the
number every time. Using TRIM() does not need to remove the extra
whitespace. Any ideas?
Basically if you do not put output="false" then it will leave
the white space for the the cftags it has removed to leave the
result. It is a crap behaviour and is there because functions can
output text without having to return it. It is a crap behaviour IMO
however some people want to use it that way.
I wish cffunction had output="false" as default instead of
the other way round, but that would be beginning of a long
wish-list!