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
when to use 'mutable' keyword and when to use 'const cast' in c++
Templates mean
What are the benefits of polymorphism?
What is the problem with multiple inheritance?
How do you use inheritance in unity?
What is polymorphism what are the different types of polymorphism?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Why multiple inheritance is not allowed?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
What is oops and why we use oops?
How to use CMutex, CSemaphore in VC++ MFC
What are the advantages of polymorphism?
What is the difference between procedural programming and oops?
What is a class in oop?
What is interface in oop?