I can\'t google the ~ operator to find out more about it. Can someone please explain to me in simple words what it is for and how to use it?
It's a tilde and it is the bitwise NOT operator.