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 the namespace for the thread class?
What can I create with c#?
Which is faster abstract class or interface in c#?
What is extension method in c sharp?
Give some examples for built in datatypes in c#?
What does console mean c#?
If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?
Give examples for reference types?
What is the difference between static and private constructor in c#?
What is desktop GUI application?
What is value c#?
Define mutex in C#?
Define a partial class?
If you define a user defined data type by using the struct keyword, is it a value type or reference type?
How can we set class to be inherited, but prevent the method from being over-ridden?