I have an input like Input 1 : THE MISSION IMPOSSIBLE
Bot should check the first word is if it contains ‘THE’ so it has to remove the word ‘THE’ and output should be - MISSION IMPOSSIBLE Input 2 : THE THE THE MISSION IMPOSSIBLE
Output should be - MISSION IMPOSSIBLE
Help needed with sample code.
Sorry for the changes…
The above given solution is working fine only when the word THE is mentioned in caps. It should work irrespective of the input is in caps or in small characters. How to edit in the current code - RightSide: Regex.Replace(strText,Pattern,"").Trim()
Input : THE THE MISSION THE IMPOSSIBLE
Output should be : MISSION THE IMPOSSIBLE
Your code removes THE whereever it is found in the line.
It should remove only THE found initially as mentioned in above example.
Also same for the word AND also. Word AND also should be removed.
@Nived, not yet tried this code. This - MISSION THE IMPOSSIBLE wont be static any words will be there.
Question is any lines starts with
What ever the no of times or combinations of AND, THE comes it should be removed only should be retained including AND THE