Package org.lionsoul.jcseg.util
Class ArrayUtil
- java.lang.Object
-
- org.lionsoul.jcseg.util.ArrayUtil
-
public class ArrayUtil extends Object
Array util class- Author:
- chenxin
-
-
Constructor Summary
Constructors Constructor Description ArrayUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcontains(String str, String[] arr)check if there is an element that contains the specified stringstatic intendsWith(String str, String[] arr)check if there is an element that ends with the specified stringstatic Stringimplode(String glue, Object[] pieces)String array implode internal methodstatic intindexOf(String ele, String[] arr)check and search the specified element in the Arraystatic intstartsWith(String str, String[] arr)check if there is an element that starts with the specified stringstatic StringtoJsonArray(String[] arr)static StringtoJsonObject(String[] arr)implode the array elements as a Json array string
-
-
-
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
-
-