Package org.apache.tika.utils
Class StringUtils
java.lang.Object
org.apache.tika.utils.StringUtils
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanstatic booleanisEmpty(CharSequence cs) static Stringstatic Stringstatic StringLeft pad a String with a specified String.static Stringrepeat(char ch, int repeat) Returns padding using the specified delimiter repeated to a given length.static StringRepeat a Stringrepeattimes to form a new String.
- 
Field Details- 
EMPTYThe empty String"".- Since:
- 2.0
- See Also:
 
- 
SPACEA String for a space character.- Since:
- 3.2
- See Also:
 
 
- 
- 
Constructor Details- 
StringUtilspublic StringUtils()
 
- 
- 
Method Details- 
isEmpty
- 
isBlank
- 
leftPadLeft pad a String with a specified String. Pad to a size of size.StringUtils.leftPad(null, *, *) = null StringUtils.leftPad("", 3, "z") = "zzz" StringUtils.leftPad("bat", 3, "yz") = "bat" StringUtils.leftPad("bat", 5, "yz") = "yzbat" StringUtils.leftPad("bat", 8, "yz") = "yzyzybat" StringUtils.leftPad("bat", 1, "yz") = "bat" StringUtils.leftPad("bat", -1, "yz") = "bat" StringUtils.leftPad("bat", 5, null) = " bat" StringUtils.leftPad("bat", 5, "") = " bat"- Parameters:
- str- the String to pad out, may be null
- size- the size to pad to
- padStr- the String to pad with, null or empty treated as single space
- Returns:
- left padded String or original String if no padding is necessary,
 nullif null String input
 
- 
leftPad
- 
repeatReturns padding using the specified delimiter repeated to a given length. StringUtils.repeat('e', 0) = "" StringUtils.repeat('e', 3) = "eee" StringUtils.repeat('e', -2) = ""Note: this method does not support padding with Unicode Supplementary Characters as they require a pair of chars to be represented. If you are needing to support full I18N of your applications consider usingrepeat(String, int)instead.- Parameters:
- ch- character to repeat
- repeat- number of times to repeat char, negative treated as zero
- Returns:
- String with repeated character
- See Also:
 
- 
repeatRepeat a String repeattimes to form a new String.StringUtils.repeat(null, 2) = null StringUtils.repeat("", 0) = "" StringUtils.repeat("", 2) = "" StringUtils.repeat("a", 3) = "aaa" StringUtils.repeat("ab", 2) = "abab" StringUtils.repeat("a", -2) = ""- Parameters:
- str- the String to repeat, may be null
- repeat- number of times to repeat str, negative treated as zero
- Returns:
- a new String consisting of the original String repeated,
 nullif null String input
 
- 
joinWith
 
-