我有一个字符串
string astring="#This is a Section*This is the first category*This is the
second Category# This is another Section";
我想根据分隔符分隔这个字符串。如果我在开头有 # 这将指示部分字符串(字符串 [] 部分)。如果字符串以 * 开头,这将表明我有一个类别(字符串 [] 类别)。结果我想拥有
string[] section = { "This is a Section", "This is another Section" };
string[] category = { "This is the first category ",
"This is the second Category " };
我找到了这个答案: string.split - by multiple character delimiter 但这不是我想要做的。