如何找到段落的结尾(TextBox 中的用户键入 ENTER)?什么是正确的正则表达式?我正在使用这段代码:
Protected Function MakeParagraph(ByVal txt As String) As String
Dim regx As New Regex("/n", RegexOptions.IgnoreCase)
Dim matches As MatchCollection = regx.Matches(txt)
For Each Match As Match In matches
txt = txt.Replace(Match.Value, "<br/>")
Next
Return txt
End Function
Protected Sub Button1_Click(sender As Object, e As EventArgs)
Label1.Text = MakeParagraph(TextBox1.Text)
End Sub