可能重複:
How do I split a string by a multi-character delimiter in C#?如何使用字符串分隔符分割字符串?
我有這個字符串:
My name is Marco and I'm from Italy
我想拆呢,帶分隔符is Marco and
,所以我應該得到一個數組與
My name
at [0] andI'm from Italy
at [1]。
我該怎麼用C#做到這一點?
試圖與
.Split("is Marco and")
,但它希望只有一個字符。
[這](http://stackoverflow.com/questions/1126915/how -do-i-split-a-string-by-a-multi-character-delimiter-in-c)之前曾被問過。 –
相關https://stackoverflow.com/questions/315358/c-sharp-syntax-split-string-into-array-by-comma-convert-to-generic-list-and – barlop