Package joptsimple.internal
Class Strings
- java.lang.Object
-
- joptsimple.internal.Strings
-
public final class Strings extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEMPTYstatic java.lang.StringLINE_SEPARATOR
-
Constructor Summary
Constructors Modifier Constructor Description privateStrings()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisNullOrEmpty(java.lang.String target)Tells whether the given string is either or consists solely of whitespace characters.static java.lang.Stringjoin(java.lang.Iterable<java.lang.String> pieces, java.lang.String separator)Gives a string consisting of the string representations of the elements of a given array of objects, each separated by a given separator string.static java.lang.Stringjoin(java.lang.String[] pieces, java.lang.String separator)Gives a string consisting of the elements of a given array of strings, each separated by a given separator string.static java.lang.Stringrepeat(char ch, int count)Gives a string consisting of the given character repeated the given number of times.static java.lang.Stringsurround(java.lang.String target, char begin, char end)Gives a string consisting of a given string prepended and appended with surrounding characters.
-
-
-
Field Detail
-
EMPTY
public static final java.lang.String EMPTY
- See Also:
- Constant Field Values
-
LINE_SEPARATOR
public static final java.lang.String LINE_SEPARATOR
-
-
Method Detail
-
repeat
public static java.lang.String repeat(char ch, int count)Gives a string consisting of the given character repeated the given number of times.- Parameters:
ch- the character to repeatcount- how many times to repeat the character- Returns:
- the resultant string
-
isNullOrEmpty
public static boolean isNullOrEmpty(java.lang.String target)
Tells whether the given string is either or consists solely of whitespace characters.- Parameters:
target- string to check- Returns:
trueif the target string is null or empty
-
surround
public static java.lang.String surround(java.lang.String target, char begin, char end)Gives a string consisting of a given string prepended and appended with surrounding characters.- Parameters:
target- a stringbegin- character to prependend- character to append- Returns:
- the surrounded string
-
join
public static java.lang.String join(java.lang.String[] pieces, java.lang.String separator)Gives a string consisting of the elements of a given array of strings, each separated by a given separator string.- Parameters:
pieces- the strings to joinseparator- the separator- Returns:
- the joined string
-
join
public static java.lang.String join(java.lang.Iterable<java.lang.String> pieces, java.lang.String separator)Gives a string consisting of the string representations of the elements of a given array of objects, each separated by a given separator string.- Parameters:
pieces- the elements whose string representations are to be joinedseparator- the separator- Returns:
- the joined string
-
-