Forums Register Login

java decode help

+Pie Number of slices to send: Send
how could i fix this methodehich must accept a String consisting of a run-length encoding of a sequence of any characters except digit
characters ('0' - '9'), and return the corresponding
non-encodedString. In a run-length encoding each "run" which represent by the number of repetitions followed by the repeated character.

Examples:
"" is decoded as ""
"1a1b1c" is decoded as "abc"
"3a" is decoded as "aaa"
"3a2b4c" is decoded as "aaabbcccc"
"5x14y1z" is decoded as "xxxxxyyyyyyyyyyyyyyz"
public String decode(String es) {
+Pie Number of slices to send: Send
 

miguel winzo wrote:how could i fix this methodehich must accept a String consisting of a run-length encoding of a sequence of any characters except digit
characters ('0' - '9'), and return the corresponding
non-encodedString. In a run-length encoding each "run" which represent by the number of repetitions followed by the repeated character.

Examples:
"" is decoded as ""
"1a1b1c" is decoded as "abc"
"3a" is decoded as "aaa"
"3a2b4c" is decoded as "aaabbcccc"
"5x14y1z" is decoded as "xxxxxyyyyyyyyyyyyyyz"
public String decode(String es) {


What method? Your post must not have worked as I only see a method fragment on the bottom.

Much luck and welcome to the ranch!
+Pie Number of slices to send: Send
String coder. Something tells me this is a school project and you're class mates
+Pie Number of slices to send: Send
lol we are i bet ..... and we looking for the same solution.
+Pie Number of slices to send: Send
And welcome to JavaRanch
straws are for suckers. tiny ads are for attractive people.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1170 times.
Similar Threads
encoding in java and decoding in perl
Problem with encoding
problem base64 encoding the 3 hex bytes E2 80 A9
JPasswordField.getPassword() method
Decoding "%5c"
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:27:01.