Class Array

java.lang.Object
de.redstoneworld.redutilities.misc.Array

public class Array extends Object
  • Constructor Details

    • Array

      public Array()
  • Method Details

    • appendStringArray

      public static String appendStringArray(String prefix, String[] array, String separator)
      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 String
      array - (String[]) the String array, which is to be merged
      separator - (String) the separator
      Returns:
      the result String; empty if array is empty
    • shiftArray

      public 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.
      Parameters:
      array - (String[]) the original String array
      shiftAmount - (int) amount of shifts
      Returns:
      a new array with the rest
    • mergeArrays

      public static String[] mergeArrays(String[] array1, String[] array2)
      This method concatenates two String arrays linear.
      Parameters:
      array1 - (String[]) 1. Array
      array2 - (String[]) 2. Array
      Returns:
      a new array with the double size