Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to list all stored procedures in the current database using ms sql server?

1054


What is clr ddl trigger?

911


What are the different types of collation sensitivity?

1055


What’s the use of custom fields in report?

889


What happens if null values are involved in boolean operations?

940


Why I am getting this error when dropping a database in ms sql server?

1021


Which sql server table is used to hold the stored procedure script?

882


sql database suspect We have a sql database that is showing as suspect. How can we recover?

1854


Does sql server 2000 full-text search support clustering?

814


What does the on update no action do?

963


on line cluster can we make if yes tell me the procedure

1976


In what three ways is the return statement used in a stored procedure?

954


Does a specific recovery model need to be used for a replicated database? : sql server replication

912


Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?

913


Do you know the cursor types?

1111