473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Converting integer to hex string

Dan
Does C# provide a function for converting an integer to a hex string?
Nov 15 '05 #1
2 54447
Hi,

yes it does,

eg
int a = 123;
a.ToString("X8"); for 8 hex characters

Greetings,

Bram

"Dan" <da*@dontspamme.com> wrote in message
news:et**************@TK2MSFTNGP10.phx.gbl...
Does C# provide a function for converting an integer to a hex string?

Nov 15 '05 #2
Dan
Thanks. It sure was hard to find that in the documentation. I did all
these searches on "integer" "convert" "hex" and came up blank.

"Bram" <bv*****@nospam.skynet.be> wrote in message
news:40*********************@news.skynet.be...
Hi,

yes it does,

eg
int a = 123;
a.ToString("X8"); for 8 hex characters

Greetings,

Bram

"Dan" <da*@dontspamme.com> wrote in message
news:et**************@TK2MSFTNGP10.phx.gbl...
Does C# provide a function for converting an integer to a hex string?


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Warder | last post by:
I'm still struggling with these conversions! The wider code is working well but I can't get the compiler to accept my attempts at converting Integers (back) into Strings. What's the trick? ...
6
by: Alex Neumann | last post by:
Hi, I need a function which converts an string to an integer. Currently I have this: bool string2int(char* digit, int& result) { result = 0; if (!(*digit >= '0' && *digit <='9'))
6
by: John | last post by:
Hi I would like to convert a number to string but with a preceding zero if the number is less than 10. How can I accomplish this? Thanks Regards
13
by: coinjo | last post by:
Is there any function to determine the length of an integer string?
1
by: Kevin S Gallagher | last post by:
I found this code (pretty sure it was from a MVP) for converting a string variable to a form object which works fine within a form. Take the code and place it into a code module and it fails on the...
1
by: Stile213 | last post by:
What's the easiest way to input an integer string using the cin function? The string will be single digits and from 1 to 5 elements long.
0
by: rrp83 | last post by:
Hi All Can anyone fwd me the code for converting a string to bytes similar to the GetBytes function in C# and viceversa?? Regards, RRP83
2
by: CoreyWhite | last post by:
Problem: You have numbers in string format, but you need to convert them to a numeric type, such as an int or float. Solution: You can do this with the standard library functions. The...
13
by: Pierre Quentel | last post by:
Hi, I would like to know if there is a module that converts a string to a value of the "most probable type" ; for instance : - if the string is "abcd" the value is the same string "abcd" -...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.