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



i have a string aabccefsdss.how can i get the string abcefsd. or write the fallowing string with o..

Answer / 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

More C Sharp Interview Questions

Are value types sealed?

0 Answers  


What is the process of Serialization?

0 Answers  


What is a string? What are the properties of a string class?

1 Answers  


What is the minimum size (in bytes) of string data type in c#? Give its compatible data type in .NET Framework.

5 Answers  


What are the types of operator?

0 Answers  






What is boolean method?

0 Answers  


What is a class level variable in c#?

0 Answers  


How can we sort an array in c#?

0 Answers  


What is parallel foreach in c#?

0 Answers  


Which is the best institute in hyderabad to learn Sharepoint Portal?

68 Answers   IBM,


What is the signature of a method?

0 Answers  


Why do we need abstraction in c#?

0 Answers  


Categories