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 difference between temp table and cte?
What do you mean by authentication modes in sql server?
what is the system function to get the current user's user id? : Sql server database administration
Give me a SQL Query to find out the second largest company?
How do I find query history in sql server?
How many types of local tables are there in sql server?
What is index fragmentation in ms sql server?
Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...
Explain what you mean by 3 tier architecture.
What is the difference between writing data to mirrored drives versus raid5 drives
How to provide default values to stored procedure parameters?
Differentiate between SQL and ORACLE joins and write their syntax.
Can a table have 2 foreign keys?
How much space does sql server 2016 take?
What is collation sensitivity? Explain different types.