How to count numbers of characters in a string?

 Posted by Rajesh_Kumar on 1/21/2014 | Category: C# Interview questions | Views: 2032 | Points: 40
Answer:

With the help of string'Length property ,we can count numbers of string characters.

For Example:-
string name = "Rajesh";

int char_count = name.Length;
MessageBox.Show(char_count.ToString());


Output would be:6


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response