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 do we use inheritance?
Can a destructor be called directly?
hi all..i want to know oops concepts clearly can any1 explain??
What is the real time example of inheritance?
What is the use of oops?
How do you answer polymorphism?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
Why is encapsulation used?
Why is oop better than procedural?
What is encapsulation and abstraction? How are they implemented in C++?
What is the oops and benefits of oops programming?
program for insertion ,deletion,sorting in double link list
What is the significance of classes in oop?
to find out the minimum of two integer number of two different classes using friend function
What are the benefits of oop?