RegEx: Replace all BUT line breaks
Code:
Dim reg As System.Text.RegularExpressions.Regex
Me.lblAnswer.Text = System.Text.RegularExpressions.Regex.Replace(lblAnswer.Text, ".", "*")
Okay, so the "." is supposed to convert everything BUT line breaks. Well it converts line breaks as well... how to change so it does not replace line breaks with "*"?
Re: RegEx: Replace all BUT line breaks
How about this?
vb.net Code:
Dim txt As String = "blahblah" & Environment.NewLine & "blah blah bleh"
Dim exp As String = "[^\r\n]"
Dim newTxt As String = Regex.Replace(txt, exp, "*")
MessageBox.Show(newTxt)