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 abstract class in oop?

526


how to get the oracle certification? send me the answer

1665


What is inheritance in simple words?

623


Why do we use encapsulation in oops?

518


Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box

2027






What is oops?what is its use in software engineering?

553


What is polymorphism and its types?

589


What is difference between multiple inheritance and multilevel inheritance?

601


Which method cannot be overridden?

574


Why do pointers exist?

655


Can we override main method?

599


Why polymorphism is used in oops?

578


Why is static class not inherited?

591


What is abstraction encapsulation?

653


program for insertion ,deletion,sorting in double link list

2276