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
How to list all stored procedures in the current database using ms sql server?
What is clr ddl trigger?
What are the different types of collation sensitivity?
What’s the use of custom fields in report?
What happens if null values are involved in boolean operations?
Why I am getting this error when dropping a database in ms sql server?
Which sql server table is used to hold the stored procedure script?
sql database suspect We have a sql database that is showing as suspect. How can we recover?
Does sql server 2000 full-text search support clustering?
What does the on update no action do?
on line cluster can we make if yes tell me the procedure
In what three ways is the return statement used in a stored procedure?
Does a specific recovery model need to be used for a replicated database? : sql server replication
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
Do you know the cursor types?