rgarimella
asked on
Reg Ex
Hi Folks,
I was trying to replace a carriage return in a form field with a <BR> but for some reason it does not work. Here is the code. If i replace "\r/g" with any other char like 13 it works.
Function EncodeBreak(ssString) 'This function replaces special characters
If len(ssString) > 0 Then
ssString = Replace(ssString, "'", "''")
ssString = Replace(ssString, "\r/g", "</BR>")
End If
EncodeBreak = ssString
End Function
any ideas
Thanks
RG
I was trying to replace a carriage return in a form field with a <BR> but for some reason it does not work. Here is the code. If i replace "\r/g" with any other char like 13 it works.
Function EncodeBreak(ssString) 'This function replaces special characters
If len(ssString) > 0 Then
ssString = Replace(ssString, "'", "''")
ssString = Replace(ssString, "\r/g", "</BR>")
End If
EncodeBreak = ssString
End Function
any ideas
Thanks
RG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just to add on real quick, you may need to use Server.CreateObject instead of just CreateObject, forgot to include that earlier
ASKER
Thanks Matt,
Worked like a charm
Worked like a charm
Glad to help!