Hi there. I've got a series of strings that are multiple sentences long. I'd like to split them all at common punctuation points, so i get a string[] of sentences.
i'm using String.Split([",",".","!","?",";"]) to accomplish the splitting, but this is unfortunately removing the punctuation as well.
i need some way to keep the punctuation, or to add it back afterward. any ideas?
I'm betting someone with more patience than I could come up with a one-line regex that could do it. Far too geeky for my tastes. I would probably try doing a series of string Replaces which insert line breaks:
s = s.Replace(",", ",
");
That puts a newline char where the linebreak should go. Do that for each punctuation mark. Then split it