Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert String into int[] array in java?
How to convert String into int[] array in java?
String s = " 485729304

int[]a = new int[s . length()];

for(int I = 0; I & lts.length (). i++)

{

//Convert the String into char, then into string, and then into Integer.

a[I]= integer . parse int(string . value of(s . charat(I)));

}

//The data in the string must be numbers, otherwise an exception will occur.

s . charat(I); Get the position value of the string I,

string . value of(); Convert a character type to a string.

integer . parse int(); Convert from string to integer