1
How to create a dynamic array in this way:
//Apenas um exemplo abaixo:
String valor0 = "1;2;3;4;5;6;7;8;9;0";
String valor1 = "1;2;3;4;5;6;7;8;9;0";
String valor2 = "1;2;3;4;5;6;7;8;9;0";
//Um array dentro de outro array, porém sem definir seu tamanho
String[][] valor = {};
//E então definir os valores do segundo [] com split também
valor[0][] = valor0.split(";");
valor[1][] = valor1.split(";");
valor[2][] = valor2.split(";");
So he would create the keys and after creating, set the values of the other array within each key with the split. The size should be with the split, because this will be dynamic, will change constantly. In cases of being just a normal array, I know that the split populates it dynamically without having to define the size, but I would like to do the same with a two-dimensional array.
The example does not work, of course, is only to show.
The array would look something like this:
array (size=3)
0 =>
array (size=10)
0 => string '1' (length=1)
1 => string '2' (length=1)
2 => string '3' (length=1)
3 => string '4' (length=1)
4 => string '5' (length=1)
5 => string '6' (length=1)
6 => string '7' (length=1)
7 => string '8' (length=1)
8 => string '9' (length=1)
9 => string '0' (length=1)
1 =>
array (size=10)
0 => string '1' (length=1)
1 => string '2' (length=1)
2 => string '3' (length=1)
3 => string '4' (length=1)
4 => string '5' (length=1)
5 => string '6' (length=1)
6 => string '7' (length=1)
7 => string '8' (length=1)
8 => string '9' (length=1)
9 => string '0' (length=1)
2 =>
array (size=10)
0 => string '1' (length=1)
1 => string '2' (length=1)
2 => string '3' (length=1)
3 => string '4' (length=1)
4 => string '5' (length=1)
5 => string '6' (length=1)
6 => string '7' (length=1)
7 => string '8' (length=1)
8 => string '9' (length=1)
9 => string '0' (length=1)
I did this example in php
It seems to me you’re looking for
ArrayList<String[]>
and notString[][]
– Isac
@Isac worse than I do not know actually kkkkk, could make an example :3
– Woton Sampaio
@Wotonsampaio you want integer or string array?
– Felipe
@Felipe de Strings
– Woton Sampaio
@Felipe was bad, it is pq in php I ended up leaving as int, already fixed here kkk
– Woton Sampaio
Quiet is that if it was whole would have a job to convert, before playing in vector
– Felipe