If I have a string array String[] array = new String[3]; , how do I get the first characters of each of the data inside that array and store in a new string array String[] newarray = new String[3];
For example:
array[0] = AB;
array[1] = AB;
array[2] = AB;
array[3] = AB;
I must get all 4 letter "A" because it is the first character in each of the data inside my String[].
So it must be like this:
newarray[0] = first character of array[0] //which is "A"
newarray[1] = first character of array[1] //which is "A"
newarray[2] = first character of array[2] //which is "A"
newarray[3] = first character of array[3] //which is "A"