Java - Fill Array With Characters From String -


i want fill unknown length of string, split character , put array, repeating process until array full. multidimensional array i'm using.

    key = input user string (length unknown)     int[][] fullkey = new int[128][2];     {         (int ii = 0; ii < key.length(); ii++) {             fullkey[i][0] = key.charat(ii);             i++;         }     } while (fullkey[encoding][0] == null); 

i know int primitive can't null it's try , explain i'm attempting do

thanks in advance

does below code fit requirement?

string key = "string"; int row = 2; int col = 128; int[][] fullkey = new int[row][col]; int counter=0;  (int = 0; < col; i++) {     fullkey[0][i] = key.charat(counter);     counter = (counter==key.length()-1) ? 0 : (counter+1); } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -