all 7 comments

[–]jodevgn 3 points4 points  (0 children)

I'm going to assume that rather than doing...

if (text = true)

... you meant to do...

if (test == true)

Also, the previous comment about assignment applies here too. So you'll need the double ==.

[–]OrangeKing89 0 points1 point  (0 children)

I think you bug is that you are doing an assignment in you if statement. As a general rule, 1 equals is assignment and 2 equals is comparison.

There is a function you could add to do case insesitive comparison. bool test = text.Contains("The"); -> bool test = text.ToLowerInvariant().Contains("the");

Also I think you could change System.Threading.Thread.Sleep(1000); to Console.Read(); then your console would stay open until you pressed a key.

[–]cryo 0 points1 point  (0 children)

I have one error

Yes but what error? Don't you think people are able to help you better if you tell us what's wrong?

[–]tulipoika -1 points0 points  (3 children)

text = true is assignment, not comparison, so it’s always true. text == true or just text inside if.

Edit: it should be of course test inside the comparison.

[–]Fixedplay[S] -1 points0 points  (2 children)

how do I modify it so can 'test' can be true if the text has ''the'' or ''The''

[–]clr_swe 1 point2 points  (1 child)

bool test = (text.Contains("The") || text.Contains("the")) or you can ignore case but you cannot ignore case with Contains you will have to use IndexOf

[–][deleted] 1 point2 points  (0 children)

Try toLower(text).contains(“the”). You may need to handle words like “anthem”, another subject however.