Search code examples
c#.netlogical-operatorsnegation

c# meaning of ! before a statement


i am writing an application someone could help me with just giving me sample code ! i'm stuck in this place ! any one have any ideas ?

bool bl = false;
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
bl = !reader.ReadToEnd().Contains("auto_load_more_enabled");
if (reader.ReadToEnd().Contains("wait"))
{
    bl = true;
}

Solution

  • ! is the NOT (negation) logical operator.

    It transform a false to true and true to false.

    Boolean logical operators (C# reference)