在 C#、Windows 窗体中,我将如何做到这一点:
07:55 Header Text: This is the data<br/>07:55 Header Text: This is the data<br/>07:55 Header Text: This is the data<br/>
所以,如您所见,我有一个返回字符串,它可能相当长,但我希望能够将数据格式化为如下所示:
<b><font color="Red">07:55 Header Text</font></b>: This is the data<br/><b><font color="Red">07:55 Header Text</font></b>: This is the data<br/><b><font color="Red">07:55 Header Text</font></b>: This is the data<br/>
如您所见,我基本上想<b><font color="Red">
在标题文本和时间的前面添加,并</font></b>
在 : 部分之前添加。
所以是的,哈哈,我有点迷路了。
我已经搞砸了.Replace()和Regex模式,但没有取得多大成功。我真的不想替换文本,只是在某些位置附加/预先挂起。
是否有捷径可寻?
注意:[] 标签实际上是 <> 标签,但我不能在这里使用它们 lol