C# 字串切割

在使用Split時可用string而不是char

string str = "A+-B+-C+-";

string[] strParameter1 = str.Split(new string[] { "+-" }, StringSplitOptions.RemoveEmptyEntries);
// strParameter[0] : "A"
// strParameter[1] : "B"
// strParameter[2] : "C"

string[] strParameter2 = str.Split(new string[] { "+-" }, StringSplitOptions.None);
// strParameter[0] : "A"
// strParameter[1] : "B"
// strParameter[2] : "C"
// strParameter[3] : ""