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 a nullreferenceexception?

779


3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close

1640


What is a three-tier application.

817


Is c# a backend language?

778


Define an abstract class?

713


What is deferred execution in c#?

740


Are c# strings null terminated?

763


What is routing in c#?

669


Explain About delegates

834


What are accessors?

764


What is the different types of private assembly and shared assembly?

744


Why do we use constructors in c#?

834


What are tuples c#?

733


Can you create sealed abstract class in c#?

686


what are the contents of an assembly ?

785