I'm trying to replace all the carriage return characters in a string obtained from a multi line text box in a Windows Form with the string ", <BR>"
so that when I use the string in some HTML it displays correctly.
Function Blah(ByVal strInput As String) As String
Dim rexCR As Object
rexCR = CreateObject("VBScript.RegExp")
rexCR.Pattern = "\r"
rexCR.Global = True
Blah = rexCR.Replace(strInput, ",<BR>")
End Function
Tried searching for any of the following characters and still no luck:
\r|\n|\r\c|\cM|\x0d
Problem seems to be the function/expression is not detecting any carriage returns in the text and I have no idea why? I know the function works as I can put a different expression in there as a test and it's OK
Any ideas?