Class Array
java.lang.Object
de.redstoneworld.redutilities.misc.Array
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
appendStringArray
(String prefix, String[] array, String separator) This method merges the Strings of a String array and outputs them as a single String.static String[]
mergeArrays
(String[] array1, String[] array2) This method concatenates two String arrays linear.static String[]
shiftArray
(String[] array, int shiftAmount) This method shifts a String array with the target amount of shifts and create a new one with the rest of it.
-
Constructor Details
-
Array
public Array()
-
-
Method Details
-
appendStringArray
This method merges the Strings of a String array and outputs them as a single String. The individual parts are connected with the separator.- Parameters:
prefix
- (String) prefix for the result Stringarray
- (String[]) the String array, which is to be mergedseparator
- (String) the separator- Returns:
- the result String; empty if array is empty
-
shiftArray
This method shifts a String array with the target amount of shifts and create a new one with the rest of it.- Parameters:
array
- (String[]) the original String arrayshiftAmount
- (int) amount of shifts- Returns:
- a new array with the rest
-
mergeArrays
This method concatenates two String arrays linear.- Parameters:
array1
- (String[]) 1. Arrayarray2
- (String[]) 2. Array- Returns:
- a new array with the double size
-