It's not a secret anymore!
The moose likes Beginning Java and the fly likes Dealing with bytes in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Dealing with bytes in java" Watch "Dealing with bytes in java" New topic
Author

Dealing with bytes in java

shruty sharma
Greenhorn

Joined: Dec 25, 2008
Posts: 4
I have a string as follows:

'mnp1011000jie'

I want to retrieve contents of the string as follows:
1st field: mnp
2nd field: 101 (which signifies the binary representation of 5)
3rd field: 1000 (which signifies the binary representation of 8)
4th field: jie

how can I do this USING CORE JAVA?

(Pattern Matching classes are not proving useful in this case)
[ December 25, 2008: Message edited by: shruty sharma ]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Splitting mnp1011000jie into mnp, 1011000 and jie is not that hard. But how do you determine how to split the remaining 1011000? Is it always 3 and 4, or what?


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8430

Hardly an advanced question.


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: Dealing with bytes in java
 
Similar Threads
insertion operator
sending pdf files to IBM MQ
Max and Min values
Have anybody take a look at this code segment......
Converting negative numbers to binary?