davidxc davidxc - 2 months ago 8
Vb.net Question

Function to replace double line breaks with paragraph tags not working

I have a function to replace double line breaks with paragraph tags, but alas - it's not working for me:

'Function to replace double line breaks with paragraph tags

Function fixParas(srcText As String) As String
fixParas = srcText
If len(fixParas) > 0 Then
fixParas = Replace(VbCrLf , "<br />")
fixParas = Replace("<br>" , "<br />")
fixParas = Replace("<br/>" , "<br />")
fixParas = Replace("<br /><br />" , "</p><p>")
fixParas = Replace("<br /></p>" , "</p>")
fixParas = Replace("<p><br />" , "<p>")
End If
End Function


As far as I'm aware, the syntax is correct, but it doesn't like something.

Answer

Try

fixParas = fixParas.Replace...