1// CONVERT ARRAY STRING TO ARRAY NUMBER
2const arrStr = ["1", "3", "5", "9"];
3const nuevo = arrStr.map((i) => Number(i));
4console.log(nuevo);
5// [1,3,5,9];
1import java.util.Arrays;
2public class StringToIntegerArray {
3 public static void main(String args[]) {
4 String [] str = {"123", "345", "437", "894"};
5 int size = str.length;
6 int [] arr = new int [size];
7 for(int i=0; i<size; i++) {
8 arr[i] = Integer.parseInt(str[i]);
9 }
10 System.out.println(Arrays.toString(arr));
11 }
12}
1String s = "1234";
2int[] intArray = new int[s.length()];
3
4for (int i = 0; i < s.length(); i++) {
5 intArray[i] = Character.digit(s.charAt(i), 10);
6}
7
8