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 / m@c

string x = "?hello?", y = "?open?";
char strm = '?';
for (int ictr = 0; ictr < y.Length; ictr++)
{
if (!strm.Equals(y[ictr]))
{
x=x.Replace(Convert.ToString(y[ictr]),"");
}

}
Response.Write(x);

Results will be <b>?hhl?</b>

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is byval and byref? What are differences between them?

1949


What is difference between abstraction and encapsulation?

810


Why is oop better than procedural?

805


Why is object oriented programming so hard?

823


• What are the desirable attributes for memory managment?

1943


Why do pointers exist?

877


to find out the minimum of two integer number of two different classes using friend function

1865


What is ambiguity in inheritance?

840


What is polymorphism in oops with example?

758


What is polymorphism explain its types?

913


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

1891


What is stream in oop?

1037


What is the difference between a mixin and inheritance?

735


Why we use classes in oop?

763


Why is oop useful?

811