Created
December 16, 2019 17:16
-
-
Save csharpforevermore/9e596835d5d34d8381105fef142e6168 to your computer and use it in GitHub Desktop.
Truncate a paragraph back to last full sentence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var s = "An example. Another example. This is omitted"; | |
s = s?.Substring(0, s.LastIndexOf(". ")+2); // cuts back to last full sentence |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment