What is the quickest way in ColdFusion (or Java) for converting a string as such:
Input:
79827349837493827498
Output:
\79\82\73\49\83\74\93\82\74\98
I'm taking an ldap guid and escaping it for a query.
I can do it as a series of MID reductions like this:
<CFSET V1 = "">
<CFSET RetVal = "">
<CFLOOP CONDITION="#V1# NEQ''">
<CFSET RetVal = RetVal & "\" & MID(V1,1,2)>
<CFSET V1 = MID(V1,3,2000)>
</CFLOOP>
But it seems like there would be something more elegant, like a regular expression replace.