Results 1 to 20 of 20
Thread: convert String to ASCII value
- 09-17-2010, 06:57 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
- 09-17-2010, 08:14 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 08:21 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
ok..
then i need to convert each character of the string into Ascii values and then concat them to a final value.
- 09-17-2010, 08:39 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 09:38 AM #5
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
same order as same as the string appears
- 09-17-2010, 11:45 AM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 11:51 AM #7
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
this also converts the each characters to its ascii values , right ?
- 09-17-2010, 11:55 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,458
- Rep Power
- 16
Either we are misunderstanding you, or you don't understand what you actually want.
At the moment I don't know which one it is.
- 09-17-2010, 12:01 PM #9
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
ok..
i have a string called s
String s = "abc";
and i want each character of this string to be converted into ascii value, if those ascii values are as following,
'a' = 'asciia'
'b' = 'asciib'
'c' = 'asciic'
so, i want the final string answer as following,
String finalAsnwer = "asciia"+"asciib"+"asciic";
i hope this is clear for you.
- 09-17-2010, 12:03 PM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 12:10 PM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 10,458
- Rep Power
- 16
- 09-17-2010, 12:15 PM #12
Member
- Join Date
- Mar 2010
- Posts
- 67
- Rep Power
- 0
exactly.. is there a way to do that ?
- 09-17-2010, 12:37 PM #13
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 01:19 PM #14
Aren't regex clever.
I can't imagine why the OP would want that.
@uthpalaw Do you know what an "ASCII" value is? Is it an int, a char, two bytes or ??
For example what is the "ASCII" value of "A"?
Have you Googled ASCII to see what that means?
- 09-17-2010, 01:29 PM #15
Moderator
- Join Date
- Apr 2009
- Posts
- 10,458
- Rep Power
- 16
Exactly...why?
Why do this?
You'll end up with, for "abc", "979899".
What use is that?
- 09-17-2010, 01:39 PM #16
That's base 10. What if he wants it in another base?"abc", "979899"
- 09-17-2010, 02:06 PM #17
Moderator
- Join Date
- Apr 2009
- Posts
- 10,458
- Rep Power
- 16
Don't you start...;)
- 09-17-2010, 02:13 PM #18
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 09-17-2010, 02:16 PM #19
Poor JosAH bored and unappreciated again.
Didn't I say: Aren't regex clever.
BTW where has the OP gone. Have we chased another one away?
- 09-17-2010, 03:02 PM #20
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Convert String to Binary
By erakhman in forum New To JavaReplies: 1Last Post: 09-01-2010, 08:25 AM -
convert boolean to string
By newbiejava in forum New To JavaReplies: 3Last Post: 07-22-2010, 03:32 PM -
convert obj to string
By isme in forum New To JavaReplies: 11Last Post: 06-14-2010, 10:54 AM -
Getting ascii from a String
By ali_sakar in forum New To JavaReplies: 1Last Post: 03-07-2009, 10:11 AM -
convert string to float
By miss_dot in forum NetBeansReplies: 1Last Post: 11-14-2007, 11:26 PM


LinkBack URL
About LinkBacks


Bookmarks