#Hey, how can I encode an ArrayList of integers to a string, and how can I decode it?

1 messages · Page 1 of 1 (latest)

pale lantern
#

Or how can I easy save an arraylist into a database?

ripe stoneBOT
#

<@&987246399047479336> please have a look, thanks.

ripe stoneBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

pallid orchid
#

u can check out #1062715379111178270

#

which is basically the same

#

i.e. array of ints to string

#

(and then to file)

#

as an example, u could have the array

int[] values = { 4, 2, 321, 0, 12 };

and make it a string like

"4,3,321,0,12"
#

by using a StringJoiner or joining-collector on streams

#

and decode it using split

hidden smelt
#

Arrays.toString then decode using split