I must say I have never had cause to use bitwise operators, but I am sure there are some operations that I have performed that would have been more efficiently done with them. How have "shifting" and "OR-ing" helped you solve a problem more efficiently?
Convert letter to lowercase:
OR
by space => (x | ' ')
('a' | ' ') => 'a'
; ('A' | ' ') => 'a'
Convert letter to uppercase:
AND
by underline => (x & '_')
('a' & '_') => 'A'
; ('A' & '_') => 'A'
Invert letter's case:
XOR
by space => (x ^ ' ')
('a' ^ ' ') => 'A'
; ('A' ^ ' ') => 'a'
Letter's position in alphabet:
AND
by chr(31)
/binary('11111')
/(hex('1F')
=> (x & "\x1F")
('a' & "\x1F") => 1
; ('B' & "\x1F") => 2
Get letter's position in alphabet (for Uppercase letters only):
AND
by ?
=> (x & '?')
or XOR
by @
=> (x ^ '@')
('C' & '?') => 3
; ('Z' ^ '@') => 26
Get letter's position in alphabet (for lowercase letters only):
XOR
by backtick/chr(96)
/binary('1100000')
/hex('60')
=> (x ^ '`')
('d' ^ '`') => 4
; ('x' ^ '`') => 25
Note: using anything other than the english letters will produce garbage results