C# Program to Count Punctuation Characters in a String
C# is a general-purpose, modern and object-oriented programming language pronounced as “C Sharp”. In this article we will see the C# program, to count punctuation characters in a given string.
- First, create a string or get the string from the user.
- Declare a variable to count the number of punctuations. If any character is matched with the punctuations, increment the count by 1.
- Print the count.