How to convert String like "FF00FF" to long (RGB) ?

I have something like this:

String s = "FF00FF";
unsigned long l;

My question is:

  • how to convert s to l.

I don't think I can use strtoul because s contains "FF00FF" and not 0xFF00FF.

An idea ?