111,126
社区成员
发帖
与我相关
我的任务
分享string content = "we sholud come form -li- or some -wo so we have - 6 -";
Regex reg = new Regex(@"\-(.*?)\-", RegexOptions.Compiled);
MatchCollection mc = reg.Matches(content);
foreach (Match mat in mc)
Console.WriteLine(mat.Groups[1].Value);string content = "we sholud come form -li- or some wo so we have - 6 -";
MatchCollection mc = Regex.Matches(content, @"(?<=-)[^-]+(?=-)");
foreach (Match m in mc)
{
richTextBox2.Text += m.Value + "\n";
}
// 56789
string content = "we sholud come form -li- or some -wo so we have - 6 -";
int i1 = content.IndexOf('-', 0);
int i2 = content.IndexOf('-', i1 + 1);
Console.WriteLine(content.Substring(i1+1,i2-i1-1 ));
string content = "we sholud come form -li- or some wo so we have - 6 -";
MatchCollection mc = Regex.Matches(content, @"-([^-]+)-");
foreach (Match m in mc)
{
richTextBox2.Text += m.Groups[1].Value + "\n";
}string content = "we sholud come form -li- or some -wo so we have - 6 -";
declare @sql varchar(2000)
set @sql=''
select @sql=right(content,len(content)-charindex('|',content))
select @sql=left(content,charindex('|',content)-1)