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
What is managed or unmanaged code?
What will a loop recorder show?
Is namespace a class?
What are the different types of comments in c#?
Give an example of removing an element from the queue?
Can you declare a field readonly?
When should we use sealed class in c#?
Why do we use constructors in c#?
Can we create multiple constructors?
How to transpose multi-dimensional array?
How can you set image source dynamically from c# application to ”test.png” file?
What is datareader c#?
Why static variables are used?
Is a games console a computer?
Which are the access modifiers available in c#?