更新时间:2023-02-23 09:52:26
正则表达式可能是此类任务的朋友:
Regular expressions are probably your friend for this kind of task:
Regex r = new Regex(@"(https?://[^s]+)");
myString = r.Replace(myString, "<a href="$1">$1</a>");
匹配 URL 的正则表达式可能需要一些工作.
The regular expression for matching URLs might need a bit of work.