C# start with uppercase letter & ends with punctuation mark
In C# Visual Studio 2012, write a method(s) for a sentence to check whether the first letter is uppercase and ends with a punctuation mark
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Priyaranjan K SPosted Oct 15, 2015, 11:04 PM
Priyaranjan K SPosted Oct 16, 2015, 12:38 PM
Raymond HighersPosted Oct 16, 2015, 12:16 PM
Thanks! That got me through the bulk of the problem. Now I need the Visual Studio 2012 C# code for when the button click event is clicked and there's nothing in the textbox, that I am supposed to give an answer in my label "Please enter a sentence."
Can you help me with this as well, or others can chime in.
Raymond HighersPosted Oct 15, 2015, 3:11 PM
Thanks for the quick reply, but that doesn't help me.
I need the C# code to write a method that checks a sentence from a textbox for the first letter to be uppercased and end with a punctuation mark. That could be a period ("."), or a question mark ("?"), or an exclamation mark ("!"). I know that a "char.IsUpper(string, index)" is used and "char.IsPunctuation(string, index)" is used.
Mukesh KumarPosted Oct 15, 2015, 1:49 PM