Given two strings like x=?hello? and y=?open?, remove any
character from string x which is also used in string y,
thus making the result x=?hll?.
Answer Posted / amadou
. static void Main(string[] args)
{
string x = "hello";
string y = "open";
string temp = "";
for (int i = 0; i < x.Length; i++)
{
if (!y.ToString().Contains(x[i]))
{
temp += x[i];
}
Console.WriteLine("temp={0}",
temp);
}
Console.Read();
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Why is oop useful?
What is the important feature of inheritance?
What is encapsulation with example?
Get me a number puzzle game-program
Why is static class not inherited?
How does polymorphism work?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
Can static class have constructor?
What is pure oop?
How to use CMutex, CSemaphore in VC++ MFC
What is methods in oop?
What is abstraction and encapsulation?
What are the benefits of oop?
What is abstraction in oops with example?
What is difference between abstraction and encapsulation?