How do I convert a hex string to an integer?

"0xffff"   ⟶   65535
"ffff"     ⟶   65535
Edit
Report