<!--- Set phone and ext. In reality, these values would be coming out of a data base or input form (over which we do not have control). ---> <cfset strPhone = "(123) 456-7890" /> <cfset strExt = "##128" /> <!--- Create full phone number complete with base number and line extension. ---> <cfset strFullPhone = ( strPhone & IIF( Len( strExt ), DE( Replace( " x#strExt#", "##", "####", "all" ) ), DE( "" ) ) ) /> <!--- Output new number. ---> #strFullPhone#