Posts

Showing posts from April, 2023

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