STRING To HEX Converter

       ret = strtoul(nes, &ptr, 16);

The strtoul() function does not take a String.

Also is there any way to left zero pad in string?

Yes.

You post code that won't compile. You don't show what is in the String instances. You don't show the output. ALL you do is whine "it doesn't work".

I'm convinced that you don't want help.