I am learning Java not so long ago, and I want to create a simple replacement library. And I can not exactly understand what method to use with this. I need the numbers to be replaced by text, while the cycle is working. And the number of values was determined by the length of the array, or what would replace it. I attach the code, the code does not handle the replacement, it simply displays the numbers.
int i1=0; String [] numbers = new String[3]; numbers[0]="1"; numbers[1]="2"; numbers[2]="3"; String[] symbols = new String[3]; symbols[0]="одИн"; symbols[1]="двА"; symbols[2]="Тры"; int LengthArray = numbers.length; do { i1=i1+1; // i1++ //System.out.println(i1); String i01 = Integer.toString(i1); System.out.println(i01.replaceAll(numbers[i1],symbols[i1])); } while(i1<=LengthArray - 1);