how to find white space between the string in coldfusion -
i need find white space between string in coldfusion
example
str="ha ppy"
whitespace=4
i need calculate how many white space between str.
how that.
a simple regex:
<cfset str="ha ppy"> <cfset spaces = rereplace(str, "\s+(\s+)\s+", "\1")> <cfoutput> <pre>spaces = [#spaces#]</pre><br> #len(spaces)# </cfoutput>
Comments
Post a Comment