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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Priyaranjan K SRank #45 · 32.5K reputationPosted Oct 15, 2015, 7:04 PM EDT
Mukesh KumarRank #119 · 18.2K reputationPosted Oct 15, 2015, 9:49 AM EDT
Raymond Highers18 reputationPosted Oct 16, 2015, 8:16 AM EDT
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.
Priyaranjan K SRank #45 · 32.5K reputationPosted Oct 16, 2015, 8:38 AM EDT
Raymond Highers18 reputationPosted Oct 15, 2015, 11:11 AM EDT
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.