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 managed or unmanaged code?

857


What will a loop recorder show?

746


Is namespace a class?

670


What are the different types of comments in c#?

677


Give an example of removing an element from the queue?

689


Can you declare a field readonly?

721


When should we use sealed class in c#?

690


Why do we use constructors in c#?

802


Can we create multiple constructors?

699


How to transpose multi-dimensional array?

789


How can you set image source dynamically from c# application to ”test.png” file?

853


What is datareader c#?

689


Why static variables are used?

721


Is a games console a computer?

686


Which are the access modifiers available in c#?

724