How can count the string ?
for ex: If i have string like 'bhaskar' then i need like
b:1
h:1
a:2
s:1
k:1
r:1
please give any idea on that
Answer Posted / samba
string s = "bhaskar";
for (int i = 0; i< s.Length; i++)
{
Console.WriteLine("{0}:{1}",s.Substring(i,1),i==2?2:1);
}
Console.ReadLine();
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is default port number for sql server 2000?
What are 3 ways to get a count of the number of records in a table?
What is de-normalization and what are some of the examples of it?
What is user-defined inline table-valued function?
Why is the need for data conversion transformations?
Why do you need a sql server?
can an automatic recovery be initiated by a user? : Sql server administration
What is the difference between left and right outer join?
tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
Detail about query optimizer?
let's assume you have data that resides on sql server 6.5. You have to move it sql server 7.0. How are you going to do it? : Sql server database administration
how do you test proper tcp/ip configuration windows machine? : Sql server database administration
What is blocking and how would you troubleshoot it? : sql server database administration
What is the federation in sql azure?
What is query parameter in ssrs?