# String to Hexadecimal Conversion

**URL:** <https://forum.kirupa.com/t/string-to-hexadecimal-conversion/94344>\
**Category:** Uncategorized\
**Created:** [November 11, 2003, 7:06pm UTC](https://forum.kirupa.com/t/string-to-hexadecimal-conversion/94344 "2003-11-11T19:06:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jess](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jess](https://forum.kirupa.com/u/jess)\
**Post date:** [November 11, 2003, 7:06pm UTC](https://forum.kirupa.com/t/string-to-hexadecimal-conversion/94344/1 "2003-11-11T19:06:17Z")

</div>

HI !

a quite simple problem in fact… …but can’t get rid of ! 😊

I parse a file from which I fetch String variables representing Hexadecimal values, in order to use them as RGB color codes.

How to convert these Strings into Hexadecimal values ?

For example, I load a variable with the value “0xFFFFFF” from a file. This varaible is a String. I want to use the value in a SetRGB function, but it can not handle String, and can’t do the conversion itself. So, how can make such a conversion ?

my\_color.setRGB(“0xRRGGBB”) does not work.  
I need my\_color.setRGB(0xRRGGBB).

Any idea ?  
:A+:
