hi ,
i am trying to write code to remove specific word from the text entered by the user
do
do
{
Console.WriteLine("enter your text");
input = Console.ReadLine();
text = input.ToLower();
result = text.Replace("remove", "");
Console.WriteLine("Edited text:" +result);
} while(text == null); {
Console.WriteLine("enter your text");
input = Console.ReadLine();
text = input.ToLower();
result = text.Replace("remove", "");
Console.WriteLine("Edited text:" +result);
} while(text == null);
in the above code i tried to remove the word remove from the text entered by the user.
but if i type removed instead of remove it should not replace it however my program is replacing it. any idea how to proceed further
for example if my input is: remove the word remove (this case output is correct)
output:the word
where as if i type input:removed the word remove
output:d the word (which is wrong)
thanks in advance