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";