473,404 Members | 2,179 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,404 software developers and data experts.

coverting string to hexvalue

hi

my input through the Gui would be

02,03,aa,ab, etc..

i would accept take thes inputs using JoptionPane.showInputDialog("Enter the data bytes seperated by a Comma");

say i would input the string 02,03,0a,0b etc

using the above input(which is in the form of a string) i need to generate a array of bytes as shown below

Byte[] data={0x02,0x03,0x0a,0x0b}

i tried doing this,but unable to figure out the exact conversion logic
can anyone help me with this
Jun 28 '07 #1
1 1416
r035198x
13,262 8TB
hi

my input through the Gui would be

02,03,aa,ab, etc..

i would accept take thes inputs using JoptionPane.showInputDialog("Enter the data bytes seperated by a Comma");

say i would input the string 02,03,0a,0b etc

using the above input(which is in the form of a string) i need to generate a array of bytes as shown below

Byte[] data={0x02,0x03,0x0a,0x0b}

i tried doing this,but unable to figure out the exact conversion logic
can anyone help me with this
I don't understand what you're trying to do here. You want to change any string to base 16?
Jun 28 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: alederer | last post by:
Hallo! I need to convert the values of a varchar (..) for bit data column to a string which can be stored in a normal varchar column (with additional information). Is there a function in db2...
2
by: Ayo Ogundahunsi | last post by:
Hi, I have this method - GetConnection in a different namespace, DLL so that i can reuse it. namespace MyCompany.ClassLibrary.Data { /// <summary> /// This Class contains database,...
3
by: Jarod | last post by:
Hey I have very simple problem... I have label let's say it's lbl. So I need it to display a counter: int counter = Convert.ToInt32(lbl.Text) +1 bl.Text = counter; In VB.Net I made it like...
5
by: Joergen Bech | last post by:
Basically, I want to convert hex values in the range "00000000" to "FFFFFFFF" to a signed, 32-bit Integer value. In VB6, I could just write lngValue = Val(hexstring$). In VB.Net, I seem to be...
12
by: Jerry Spence1 | last post by:
I have the string "15" which I need represented as a hex number - ie &H15 Simple I would have thought but I can't find the answer. -Jerry
0
by: santoshsri | last post by:
Hello, I have written a Console application in C#, it basically imports data from tab delimited text files and save in SQl Server database. I am converting currency format of Mortgage value into...
8
by: Tony B | last post by:
I have a string in a existing php script which is in the form "dd/mm/yyyy" and I need to convert it into a suitable format for mysql which is "yyyy-mm-dd" Is there a neat way of doing this in php ?
3
by: kronecker | last post by:
I have a Hex number say AEFF that I need as a string for the serial port. How to convert it? Will (strCmd isa string) strCmd=&AEFF do the job or is it strCmd="&AEFF"
12
by: aatif | last post by:
I want to convert a string of hex characters (2 hex chars = 1 byte), to ASCII. Hex chars include zeros (0x00) as well, which I want to include in ASCII string. hex string: 5000005355.... ASCII:...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.