Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java split array into two

String[] array = {"0","1","2","3","4","5","6","7","8","9"};
String[] a = Arrays.copyOfRange(array, 0, 4); //<- (targetArray, start, to)
String[] b = Arrays.copyOfRange(array, 4, array.length);

Output:
a: 0,1,2,3
b: 4,5,6,7,8,9
Comment

PREVIOUS NEXT
Code Example
Java :: fabric8 create namespace 
Java :: java get size of jframe 
Java :: java console write 
Java :: java last element in array 
Java :: table of any number in java 
Java :: spring serve robots.txt 
Java :: A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction 
Java :: get height of a dialog fragment android 
Java :: React-Native Firebase Requests from referer are blocked 
Java :: androidx.fragment.app.Fragment$InstantiationException 
Java :: android navigation bar color change 
Java :: java swing jtable zebra stripes 
Java :: data to string format java 
Java :: java verify string is hexadecimal 
Java :: dagger kapt dependency and plugin 
Java :: java one line if else 
Java :: how to clear activity stack in android 
Java :: kotlin android intent pass data 
Java :: java string array add element 
Java :: primefaces calendar min date validation 
Java :: java read string input 
Java :: java eliminate numbers from string 
Java :: first and last digit sum java 
Java :: how to find a specific word in a text file in java 
Java :: retrofit dependencies in android studio kotlin 
Java :: how to convert outputstream to bytearrayoutputstream in java 
Java :: java date time 
Java :: java iterate through map 
Java :: java csv 
Java :: offsetdattime to date 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =