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

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -