Dr.Ajay Kashyap

Dr.Ajay Kashyap

  • NA
  • 521
  • 277.5k

How to capitalize first character after dot (.) and

Nov 24 2017 5:36 AM
How to capitalize first character after dot (.) and first character of string.
 
user insert like this :-
 
construct a vector for each answerer based. on the answers that they've written . this
vector can encode what the author knows about .then, when a new question comes in.
wonstruct a vector for each answerer based. on the answers that they've written . this
vector can encode what the author knows about .then, when a new question comes in.
qonstruct a vector for each answerer based. on the answers that they've written . this
vector can encode what the author knows about .then, when a new question comes in
 
And I want to display like this :-
 
Construct a vector for each answerer based. On the answers that they've written . This
vector can encode what the author knows about .Then, when a new question comes in.
Wonstruct a vector for each answerer based. On the answers that they've written . This
vector can encode what the author knows about .Then, when a new question comes in.
Qonstruct a vector for each answerer based. On the answers that they've written . This
vector can encode what the author knows about .Then, when a new question comes in
 
This Is My Code (It also Contain tags):-
 
string description ="<div><b><u>Construct a vector for each answerer based. On the answers that they've written . This&nbsp;</u></b></div><div><b><u>vector can encode what the author knows about .Then, when a new question comes in.</u></b></div><div><font face=\"georgia\"><br></font></div><div><div><font face=\"georgia\">Wonstruct a vector for each answerer based. On the answers that they've written . This&nbsp;</font></div><div><font face=\"georgia\">vector can encode what the author knows about .Then, when a new question comes in.</font></div></div><div><br></div><div><div><b><i><font face=\"courier new\">Qonstruct a vector for each answerer based. On the answers that they've written . This&nbsp;</font></i></b></div><div><b><i><font face=\"courier new\">vector can encode what the author knows about .Then, when a new question comes in</font></i></b></div></div>"
 
var sourcestring = description;
var v = new Regex(@"(^[a-z])|[?!.:,;]\s+(.)|[.][a-z]|.(< >)[a-z]", RegexOptions.ExplicitCapture);
var SentanceCasedis = v.Replace(sourcestring.ToLower(), s => s.Value.ToUpper());

Answers (3)