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 / jethvamohit

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string str = "mohim";
string str1 = "mo";
remove(str, str1);
}
private static void remove(string str,string str1)
{
char[] abc;
abc = str.ToCharArray();
char[] bcd;
string str4 = "";
bcd = str1.ToCharArray();
for (int i = 0; i < bcd.Length; i++)
{
for (int j = 0; j < abc.Length; j++)
{
if (abc[j] != bcd[i])
{

str4 = str4 + abc[j];
}
}
abc = str4.ToCharArray();
str4 = "";
}
Console.Write(abc);
Console.ReadLine();

}
}
}

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1889


What is the difference between a mixin and inheritance?

739


write a programe to calculate the simple intrest and compund intrest using by function overlading

1895


What are the important components of cohesion?

745


What is abstraction and encapsulation?

772


What does and I oop and sksksk mean?

863


What does and I oop mean?

835


officer say me - i am offered to a smoking , then what can you say

1840


what type of question are asked in thoughtworks pair programming round ?

1962


Please send ford technologies placement paper 2 my mail id

1845


What is class encapsulation?

820


What are different oops concepts?

775


What is encapsulation and abstraction? How are they implemented in C++?

847


What is difference between data abstraction and encapsulation?

839


Can main method override?

834