473,382 Members | 1,369 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,382 software developers and data experts.

byte.toString("X") always return 2 characters

Hello,

with byte.toString("X"), if the decimal value of the byte is <16, then that
return opnly one character.
Is it possible (with a short things like another formatprovider than "X") to
always have the result on 2 characters, with the first 0 in this case

Thx
May 16 '06 #1
3 7174
ToString("0X")

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.

"Geoffrey" <AE**************@dufour.be> wrote in message
news:Of*************@TK2MSFTNGP02.phx.gbl...
Hello,

with byte.toString("X"), if the decimal value of the byte is <16, then
that
return opnly one character.
Is it possible (with a short things like another formatprovider than "X")
to
always have the result on 2 characters, with the first 0 in this case

Thx

May 16 '06 #2


Geoffrey wrote:

with byte.toString("X"), if the decimal value of the byte is <16, then that
return opnly one character.
Is it possible (with a short things like another formatprovider than "X") to
always have the result on 2 characters, with the first 0 in this case


byte.ToString("X2")
is probably what you are looking for.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
May 16 '06 #3
Thx

"Martin Honnen" <ma*******@yahoo.de> a écrit dans le message de
news:%2****************@TK2MSFTNGP03.phx.gbl...


Geoffrey wrote:

with byte.toString("X"), if the decimal value of the byte is <16, then that return opnly one character.
Is it possible (with a short things like another formatprovider than "X") to always have the result on 2 characters, with the first 0 in this case


byte.ToString("X2")
is probably what you are looking for.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

May 16 '06 #4

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

Similar topics

1
by: Patrick | last post by:
Hello all! I am using a BufferedImage object to build an image from scratch. I want it to be a grayscale image with only 8bits of color. I have the color information as a byte, saved in variable...
81
by: Matt | last post by:
I have 2 questions: 1. strlen returns an unsigned (size_t) quantity. Why is an unsigned value more approprate than a signed value? Why is unsighned value less appropriate? 2. Would there...
86
by: Randy Yates | last post by:
In Harbison and Steele's text (fourth edition, p.111) it is stated, The C language does not specify the range of integers that the integral types will represent, except ot say that type int may...
2
by: gg | last post by:
Hello, every body: in C++ we can use springf("02X",byte) to get the string like following: "0D","AB","9C"... but in C# i use Byte.ToString("X") can get "D","AB","9C"... how to get like "0D"? ...
7
by: al | last post by:
Greetings all, I use request.form("textbox1") to get data back to page, dim str as string str = request.form("textbox1").tostring But str is always empty after refresh???? I use asp.net...
4
by: Greg Collins [Microsoft MVP] | last post by:
Will DateTime.Now.ToString("s") ALWAYS return the same formatting (i.e. the sortable XML Schema style formatting) regardless of what culture the operating system is set to? I've done limited...
0
by: Ismail Fatih Yıldırım | last post by:
I modified the RSACSPSample from MSDN to try out a simple commutative encryption model using RSA encryption but when i run the progrem the first encryption command works but during the second...
0
by: suvarna1026 | last post by:
I am facing problem in HttpSendRequest() API(Developing OCX for Http Upload control.).It always return false.Any idea?I am posting my code: Public Function UploadFileHTTP(ByVal localFileName As...
7
by: Ray Proffitt | last post by:
Hi. obj.ToString(); or obj + ""; Which is more efficient and why?
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.