本文介绍了'string.Join(string, string[])' 的最佳重载方法匹配有一些无效参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想提取两个标签之间的文本.txtReadfile"包含许多标签.我想在每次出现标记时提取所有文本.
I want to extract come text between two tags. The "txtReadfile" contains many tags. I want to extract all the text in each occurrence of the tag.
我使用了以下代码.但是当我运行它时,它给出了错误:
I used the following code. but when I ran it, it gives the error:
Error # Error1 "The best overloaded method match for 'string.Join(string, string[])' has some invalid arguments" Error # "Argument '2': cannot convert from 'System.Collections.Generic.List<string>' to 'string[]' "你能帮我调试一下吗?
List<string> destList = new List<string>(); string me = " <ts>(.*?)<t>"; string text =txtReadfile.Text; foreach (Match match in Regex.Matches(text, me)) destList.Add(match.Groups[1].Value); string output= string.Join(" ", destList); MessageBox.Show(output); 推荐答案尝试:
string output = string.Join(" ", destList.ToArray());更多推荐
'string.Join(string, string[])' 的最佳重载方法匹配有一些无效参数
发布评论