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 connect of datebase with sql express.?
How to provide login information for a new odbc dsn?
What is standby servers? Explain types of standby servers.
How do I delete a sql server database?
What is store procedure? When do you use?
What is implicit mode in sql server?
How to call a function from a stored procedure in SQL Server ?
How would you go about developing a ssrs report?
What is difference between join and natural join?
I have a table Events Events containing cardno,time,id,name--each id has a cardno my requirement is every day each employee swipe the card several times i want to calculate first and last time of each card the output should be name 1 2 6 7 in out in out holiday holiday xxx 09:30 06:30 09:40 06:45 where 1,2...... are dates for example january 1,2, etc. 6 and 7 are saturday and sunday how it is posssible
What is wide table?
How to connect to a sql server using odbc_connect()?
Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?
List some advantages and disadvantages of stored procedure?
What is difference between equi join and natural join?