How to split a string while ignoring the case of the delimiter?

前端 未结 8 473
梦谈多话
梦谈多话 2021-01-01 09:56

I need to split a string let\'s say \"asdf aA asdfget aa uoiu AA\" split using \"aa\" ignoring the case. to

\"asdf \"
\"asdfget \"
\"uoiu \"
8条回答
  •  囚心锁ツ
    2021-01-01 10:12

    It's not the pretties version but also works:

    "asdf aA asdfget aa uoiu AA".Split(new[] { "aa", "AA", "aA", "Aa" }, StringSplitOptions.RemoveEmptyEntries);
    

提交回复
热议问题