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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the namespace for the thread class?

516


What can I create with c#?

490


Which is faster abstract class or interface in c#?

544


What is extension method in c sharp?

481


Give some examples for built in datatypes in c#?

552






What does console mean c#?

497


If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?

555


Give examples for reference types?

541


What is the difference between static and private constructor in c#?

458


What is desktop GUI application?

507


What is value c#?

462


Define mutex in C#?

617


Define a partial class?

506


If you define a user defined data type by using the struct keyword, is it a value type or reference type?

517


How can we set class to be inherited, but prevent the method from being over-ridden?

535