Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How i can use regex for sentence case without replace method in c#


What I have tried:

Regex.Replace(str, "[@"(^[a-z])|\.\s+(.)", m => m.Value[0] + " " + char.ToLower(m.Value[1]));
Posted
Updated 6-Oct-17 21:59pm

1 solution

You are either going to have to use Regex.Replace; or one or more of string.Replace, string.Substring, or a StringBuilder with the results from Regex.Match: you can't "use a regex" on it's own without Replace and expect the input string to change in any way.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900