using System;

public class Demo
{
    static void Main()
    {
        string str = "|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20";

        string delimStr = "|";
        string[] split = str.Split(delimStr.ToCharArray());

        int [] a = new int[split.Length - 1];
        for(int i = 0; i < split.Length - 1; i++)
        {
            a[i] = int.Parse(split[i + 1]);
        }

        foreach (int temp in a)
        {
            Console.WriteLine(temp);
        }
    }
}

相关文章:

  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2021-07-27
  • 2022-12-23
  • 2021-05-22
猜你喜欢
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案