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
Explain the concepts and capabilities of sql server?
Tell about MOM Tool(Microsoft Operator Manager)?
Can we install sql server 2016 on windows 7?
Can truncate be rolled back?
How to modify an existing user defined function?
Mention the different authentication modes in sql server.
How to throw custom exception in Stored Procedure?
List the different index configurations possible for a table?
How to create dbo table in sql server?
How do you test your database? : sql server database administration
Can the “if update (colname)” statement be used in a delete trigger?
when would you go for denormalization? : Sql server database administration
What is difference between equi join and natural join?
What is sharding?
What is BLOCK statements in SQL?