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

There’s no easy way to accomplish this using string.Split. (Well, except for specifying all the permutations of the split string for each char lower/upper case in an array – not very elegant I think you’ll agree.)

However, Regex.Split should do the job quite nicely.

Example:

var parts = Regex.Split(input, "aa", RegexOptions.IgnoreCase);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)