Looking for regex solution for following scenaio:
I have strings, which i have to split on the upper case basis but consecutive uppercase parts should not get split.
For example : if the input is
DisclosureOfComparativeInformation
O/p should be
Disclosure Of Comparative Information
But consecutive uppercase should not get split.
GAAP
should not result in G A A P
.
How to find the particular pattern and insert space?
Thanx
Try -
var subjectString = "DisclosureOfComparativeInformation";
var resultString = Regex.Replace(subjectString, "([a-z])([A-Z])", "$1 $2");
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