private int GetCharCount(string word)
{
//the below piece of code will convert the word to a char array
int charCount = word.ToCharArray().Length;
return charCount;
}
Count of Words in a string
private int GetWordCount(string text)
{
int wrdCount = text.Split(' ' ).Length;
return wrdCount;
}

Vaibhav SinghPosted Dec 22, 2018, 4:57 AM
Like Is there is a string called "vaibhav" Output would be like below v : 2 a : 2 i :1 b : h h : 1
Vaibhav SinghPosted Dec 22, 2018, 4:57 AM
Princy can you do something like below without using For Loop ?