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

Explain about multithreading?

0 Answers  


What is the property of a class in c#?

0 Answers  


What does firstordefault mean in c#?

0 Answers  


What is the difference between User controls and Custom Controls?

0 Answers   Accenture,


What is the use of jit ? Jit (just - in - time) is a compiler which converts msil code to

0 Answers  






What is the usage of transponders?

0 Answers   Wipro,


How big is an int16?

0 Answers  


What does assert() do in c#?

0 Answers  


How to find the current application file path while runtime?

0 Answers  


what is collections and what is generics

4 Answers   Bally Technologies,


What are properties in C#?

0 Answers   UGC Corporation,


Define property in c#.net?

0 Answers  


Categories