# Visual Basic > Xamarin >  [RESOLVED] How to convert emoji's unicode strings

## vuyiswamb

Good Day All 

i have a unicode character which works very well 

           /// Thinking face 🤔
           /// </summary>
            UnicodeString Thinking  =0x1f914; 

as you can see the value here is "0x1f914" 

so i use this site which has a list of emoji's [Full Emoji List, v12.0](http://www.unicode.org/emoji/charts/...moji-list.html) 

but the code in that website is "U+1F914"	

how do i convert U+1F914 to 0x1f914 in c# 

thanks

----------


## jmcilhinney

The '0x' is part of the code, not part of the value.  It's just how hexadecimal literals are indicated in code, just like double quotes around text indicates a string literal and single quotes a char literal.  If you want a string that contains "U+1F914" from that number then you would use something like this:

csharp Code:
var text = $"U+{number:X}";
or:

csharp Code:
var text = "U+" + number.ToString("X");
The 'X' format specifier indicates upper-case hexadecimal.

----------


## jmcilhinney

Hmmm... I think I may have misinterpreted the question and got it the wrong way around.  Are you saying that you want to get a number from the text?  If so then something like this:

csharp Code:
var number = Convert.ToInt32(text.Substring(2), 16);
or:

csharp Code:
var number = int.Parse(text.Substring(2), NumberStyles.HexNumber);

----------


## vuyiswamb

Good Day 



After i looked closely on the string , with lack of knowledge of the unicode stuff , i realized i just needed to replace the character and the emoji will be translated  , the code below simply solved the problem




```
        txtresults.Text = txttext.Text.Replace("U+", "0x").ToLower();
```

----------


## vuyiswamb

Good Day 



After i looked closely on the string , with lack of knowledge of the unicode stuff , i realized i just needed to replace the character and the emoji will be translated  , the code below simply solved the problem




```
        txtresults.Text = txttext.Text.Replace("U+", "0x").ToLower();
```

----------


## Prahlad

Hello , @vuyiswamb

Please try this code,To convert emoji's unicode strings:


```
var convertStr = string.Join("-", Regex.Matches(res, @"..").Cast<Match>().ToList());
String[] tempArr = convertStr.Split('-');
byte[] decBytes = new byte[tempArr.Length];
for (int i = 0; i < tempArr.Length; i++)
{
    decBytes[i] = Convert.ToByte(tempArr[i], 16);
}
String str = Encoding.BigEndianUnicode.GetString(decBytes);
```

I hope this code will be usefull for you.
Thank you.

----------

