APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.joptsimple.internal

public final Class Strings

extends Object
Class Inheritance
Imports
java.util.Iterator

Author
Paul Holser

Field Summary

Modifier and TypeField and Description
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the target string is null or empty
isNullOrEmpty
(String
string to check
target
)

Tells whether the given string is either or consists solely of whitespace characters.

public static String

Returns:

the joined string
join
(String[]
the strings to join
pieces
,
String
the separator
separator
)

Gives a string consisting of the elements of a given array of strings, each separated by a given separator string.

public static String

Returns:

the joined string
join
(Iterable<String>
the elements whose string representations are to be joined
pieces
,
String
the separator
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.

public static String

Returns:

the resultant string
repeat
(char
the character to repeat
ch
,
int
how many times to repeat the character
count
)

Gives a string consisting of the given character repeated the given number of times.

public static String

Returns:

the surrounded string
surround
(String
a string
target
,
char
character to prepend
begin
,
char
character to append
end
)

Gives a string consisting of a given string prepended and appended with surrounding characters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
public static final String EMPTY
LINE_SEPARATORback to summary
public static final String LINE_SEPARATOR

Constructor Detail

Stringsback to summary
private Strings()

Method Detail

isNullOrEmptyback to summary
public static boolean isNullOrEmpty(String target)

Tells whether the given string is either or consists solely of whitespace characters.

Parameters
target:String

string to check

Returns:boolean

true if the target string is null or empty

joinback to summary
public static String join(String[] pieces, String separator)

Gives a string consisting of the elements of a given array of strings, each separated by a given separator string.

Parameters
pieces:String[]

the strings to join

separator:String

the separator

Returns:String

the joined string

joinback to summary
public static String join(Iterable<String> pieces, 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:Iterable<String>

the elements whose string representations are to be joined

separator:String

the separator

Returns:String

the joined string

repeatback to summary
public static String repeat(char ch, int count)

Gives a string consisting of the given character repeated the given number of times.

Parameters
ch:char

the character to repeat

count:int

how many times to repeat the character

Returns:String

the resultant string

surroundback to summary
public static String surround(String target, char begin, char end)

Gives a string consisting of a given string prepended and appended with surrounding characters.

Parameters
target:String

a string

begin:char

character to prepend

end:char

character to append

Returns:String

the surrounded string