How to get only the number from a alphanumeric String in ColdFusion

 If the input contains numbers and characters, and we need to get only the numeric part from that, we can use reReplace Function in Coldfusion like this:


<cfset test = "rtf4545">

<cfset result = reReplace(trim(test),"[^0-9\.]+","","All")>

<cfoutput>#result#</cfoutput>


Output:

4545

Comments

Popular posts from this blog

how to add new line in google form questions | Fix for next line issue in google form questions

How to add new line in dropdown type question in google forms