Sign in to follow this  

Java: 2d char Array to Array of String

This topic is 3589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all im doing a bit of J2ME programming at the minute as a learning experience, my problem is, i have a 2d array and id like to convert it to an array of strings. My current method is: char CharArray[][] = new char 2d array; String StringArray[] = new String array; for 20 iterations { StringArray[i] = CharArray[].toString(); } can anyone state any problems they see, also i think itd be so much easier for me if i could manipulate an element of the string at any point. so another question is: Is there a way to manipulate a string element at a selected index. I know of the string.CharAt( index ) function can this be used to directly change data at that index

Share this post


Link to post
Share on other sites
Java arrays are quite a bit more capable than C or C++ ones. It's common for J2ME programmers to avoid the String class and just work with char[] buffers, for better or worse. This way you can just manipulate the buffer contents. Operations such as concatenation become quite tricky, though.

Share this post


Link to post
Share on other sites

This topic is 3589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this