Archived
1
0

optimise files

This commit is contained in:
2025-11-25 20:14:10 +08:00
Unverified
parent bb4a37acc4
commit 4e148364a9
171 changed files with 6555 additions and 0 deletions

23
CS/15_7/Program.cs Normal file
View File

@@ -0,0 +1,23 @@
using System.Text.RegularExpressions;
namespace _15_7
{
internal class Program
{
static void Main(string[] args)
{
MatchCollection mc;
string[] result = new string[20]; int[] matchposition = new int[20];
Regex r = new Regex("abc");
mc = r.Matches("123abc4abcd");
Console.WriteLine("源字符串123abc4abcd");
Console.WriteLine("匹配字符串abc");
for (int i = 0; i < mc.Count; i++)
{
result[i] = mc[i].Value;
matchposition[i] = mc[i].Index;
Console.WriteLine("索引位置{0};结果{1}", mc[i].Index, mc[i].Value);
}
}
}
}