i have a string aabccefsdss.how can i get the string abcefsd.
or write the fallowing string with only character
occurrence of once .



i have a string aabccefsdss.how can i get the string abcefsd. or write the fallowing string with o..

Answer / dinesh

string s = "aabccefsdss";
char[] a = s.ToCharArray();
string d="";
foreach (char c in a)
{
if (!d.Contains(c.ToString()))
{
d = d + c;
}
}
MessageBox.Show(d);

Is This Answer Correct ?    7 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can we create instance of private class in c#?

0 Answers  


What are the benefits of using windows services:

0 Answers  


What is the process of Serialization?

0 Answers  


Define encapsulation?

0 Answers   Siebel,


What does dbml mean in texting?

0 Answers  


What are the steps to create a webservice and consume it?

0 Answers  


How many variables do you need?

0 Answers  


Write down the c# syntax to catch an exception

0 Answers  


What is predicate c#?

0 Answers  


What is the difference between iqueryable and ienumerable?

0 Answers  


What is icomparable in c#?

0 Answers  


What is default access specifier for class in c#?

0 Answers  


Categories