Home > Back-end >  How do you split the Java string please?
How do you split the Java string please?

Time:09-24

Java string array, excuse me [DE "ABC", "ABC" qq] this string array, will be the first element can be divided into "ABC" "DE" this two strings?

CodePudding user response:

Break up, not separate, called the wrong number

CodePudding user response:

For example
 String STR=new String [] [] {DE "ABC", "qq ABC"}; 
For (String s: STR) {
String [] TMP=s.s plit (" \ \ s + ");
System. The out. Println (Arrays. ToString (TMP));
}

CodePudding user response:

Can ah
String [] strArrs=new String [] {DE "ABC", "qq ABC"};
String STR=strArrs [0].
String [] arrs=STR. The split (" ");
For (int I=0; I & lt; Arrs. Length; I++) {
System. The out. Println (" first "+ I +" value "+ arrs [I]);
}
  • Related