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

Ascii to integer

I need to convert X to 88,

Can some1 tell me.

Thanks...

Sep 11 '06 #1
5 21719


Actually, need to convert X to 88

and then back to string to display on a textbox.

Thanks..
moni wrote:
I need to convert X to 88,

Can some1 tell me.

Thanks...
Sep 11 '06 #2
Heres a function that will return the ascii values of each character in a
string, seperated by comma's
Adpapt at will:

private string ToASCIIIntInString(string instr)
{
char[] chars = instr.ToCharArray();
string[] asciis = new string[chars.Length];
int charCount = chars.Length;
for(int x;x<charCount;x++)
{
asciis[x] = ((int)chars[x]).ToString();
}

return string.Join(asciis, ", ");

}

HTH

Ciaran O'Donnell
"moni" wrote:
>

Actually, need to convert X to 88

and then back to string to display on a textbox.

Thanks..
moni wrote:
I need to convert X to 88,

Can some1 tell me.

Thanks...

Sep 11 '06 #3
string s = "X";
foreach(byte b in System.Text.ASCIIEncoding.ASCII.GetBytes(s))
Console.WriteLine(b);

Actually, need to convert X to 88

and then back to string to display on a textbox.

Thanks..

moni wrote:
>I need to convert X to 88,

Can some1 tell me.

Thanks...

Sep 11 '06 #4
moni wrote:
moni wrote:
>I need to convert X to 88,
Actually, need to convert X to 88
char c = 'X';
int i = (int)c;
char c2 = (char)i;

should work.

Arne
Sep 11 '06 #5
"moni" <mo*******@gmail.comwrote
>I need to convert X to 88,

Can some1 tell me.
int x = Convert.ToInt32(x);
string s = x.ToString();

--
Chris Mullins, MCSD.NET, MCPD:Enterprise

Sep 11 '06 #6

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

Similar topics

2
by: lucas | last post by:
hello one and all, i am very new to java and i need to take an ascii character, say "A" or "a" and convert it into its ascii integer code, say 65 or 97 respectively. then i need to also go in...
12
by: David Williams | last post by:
Hi all, i have been able to convert an ASCII character to an INT however im lost as to how to change them back. Cant find anything on the net (though im probably looking in the wrong places!)....
5
by: sathyashrayan | last post by:
Group, I have some doubts in the following program. ------------------program--------------------- /* ** Make an ascii binary string into an integer. */ #include <string.h> unsigned int...
8
by: Nik Martin | last post by:
If I receive a message from the .net sockets class, it's a byte array. The original message is an ASCII string,like "70,70,70,70,70,0,0,0,0". The commas here represent individual bytes. The 70's...
5
by: Sia Jai Sung | last post by:
Hi, I have a class that I modify from a sample program, like below ========================================== Imports System Imports System.Web.UI Imports System.Security.Cryptography ...
2
by: Arnold | last post by:
For some of my secondary students studying bits and bytes, I'd like to make a form in which they can create secret codes with bytes. I'd like the form to have a memo field that can only accept 0s...
16
by: akarui.tomodachi | last post by:
What is the most easiest way to convert an integer value to ASCII character format ? I tried with sprintf(). It works. Is there any other way to do that ? Objective:: I like to convert an...
7
by: Joris De Groote | last post by:
Hi, I have a 1 dimensional table byte with a number af characters in ASCII code. How do I convert those ASCII codes to real letters? Thanks
10
by: John | last post by:
Is there any built in function that converts ASCII to integer or vice versa in Python? Thanks!
9
by: =?Utf-8?B?RGFu?= | last post by:
I have the following code section that I thought would strip out all the non-ascii characters from a string after decoding it. Unfortunately the non-ascii characters are still in the string....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.