Is there an elegant way to split up string at first (and only first) occurence of two or more whitespaces ? Or at least finding the index of this two or more whitespaced string.
Thank you very much.
You can construct an instance instead of using the static method and utilize the overload which restricts the number of splits performed:
Regex regex = new Regex(@"\s{2,}");
string[] result = regex.Split(input, 2); // only 1 split, two parts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With