James Mercer
James Mercer

Reputation: 111

what does the ! in this mean?

I came across this in a code and was wondering what it was for?

thistime = !thistime;

Upvotes: 0

Views: 155

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564403

This is the logical negation unary operator for C#. It basically is the "opposite" of the boolean value. If thistime was false previously, this will set it to true.

Upvotes: 9

Related Questions