Class ArrayUtil


  • public class ArrayUtil
    extends Object
    Array util class
    Author:
    chenxin
    • Constructor Detail

      • ArrayUtil

        public ArrayUtil()
    • Method Detail

      • implode

        public static String implode​(String glue,
                                     Object[] pieces)
        String array implode internal method
        Parameters:
        glue -
        pieces -
        Returns:
        String
      • indexOf

        public static int indexOf​(String ele,
                                  String[] arr)
        check and search the specified element in the Array
        Parameters:
        ele -
        arr -
        Returns:
        int
      • startsWith

        public static int startsWith​(String str,
                                     String[] arr)
        check if there is an element that starts with the specified string
        Parameters:
        str -
        Returns:
        int
      • endsWith

        public static int endsWith​(String str,
                                   String[] arr)
        check if there is an element that ends with the specified string
        Parameters:
        str -
        Returns:
        int
      • contains

        public static int contains​(String str,
                                   String[] arr)
        check if there is an element that contains the specified string
        Parameters:
        str -
        Returns:
        int
      • toJsonObject

        public static String toJsonObject​(String[] arr)
        implode the array elements as a Json array string
        Parameters:
        arr -
        Returns:
        String
      • toJsonArray

        public static String toJsonArray​(String[] arr)