string[] A;
string B = "abcd@@efg@@sdff;";
string C=abcde@efgasdfl@sdlfjs;
如果要分割C很容易,只需如此即可:
A = C.Split('@');
结果:
A[0] = "abcde";
A[1] = "efgasdfl";
A[2] = "sdlfjs";
如果要分割B呢?最简单的办法就是先把@@替换为单字符串了。
A = B.Replace("@@","$").Split('$');
A[0] = "abcd";
A[1] = "efg";
A[2] = "sdff";
时间: 2024-12-23 04:04:19