我收到这样的文字:
string richText = new TextRange(textBoxUrls.Document.ContentStart, textBoxUrls.Document.ContentEnd).Text;
Console.WriteLine(richText);
文中有链接,每个链接都以https://
例如开头,像这样:
https://site-1.com
https://site-3.com
https://site-4.com
https://site-22.com
https://site-323.com
如何从这些链接创建一个数组以便以后使用?
该方法将文本拆分成行,对行进行过滤,只返回满足条件的行,即以 开头的行
https://
。也用于Trim()
删除数组中每个链接开头和结尾的空格和制表符。