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
What is difference between inheritance and polymorphism?
What are the important components of cohesion?
Can main method override?
What is difference between data abstraction and encapsulation?
What is destructor oops?
What is abstraction in oop?
What is this pointer in oop?
What are classes oop?
write a C++ program for booking using constructor and destructor.
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
Is data hiding and abstraction same?
Can you explain polymorphism?
What is difference between multiple inheritance and multilevel inheritance?
Why multiple inheritance is not possible?