It's doing exactly what you told it to: replace all instances of those strings with nothing. You haven't specified in anyway that you mean only whole words. What you'll want to use here is
regular expressions[
^]. In this case, what will be of specific interest to you is the special group "\b", which is word boundary. For example, using the regular expression "\bam\b" will only match "am" if it isn't part of another word (note, this will however match in some cases where there is not a space before and after, like if it appears at the beginning or end of a string, or before or after punctuiation, like "am.", but I'm guessing you want that).
In C#, regular expressions can be used with the
Regex[
^] class.
For example:
line = Regex.Replace(line, @"\bam\b", "");
will replace "am" in line with an empty string. (And, in case you haven't seen it before, the @ before the string specifies that the escape character, \, will just be treated as itself, which is helpful when writing regular expressions, otherwise the example would become "\\bam\\b", and can start to become more difficult to read in more complicated patterns.)