| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | |
| private static final Pattern | |
| private static final Pattern | NORMALIZE_PATTERN
Pattern for normalizing whitespace and punctuation using named capture groups |
| public static final String | |
| private static final Pattern | |
| private static final String | |
| private static final UnicodeToReadableCharMap | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addWrappedLine(StringBuilder result, String
the line of text to be wrapped and appended line, int the number of characters belonging to a line of text wrapAmount, String a string containing the newline character(s) newlineString)Appends a text to a string builder. |
| public static String | |
| public static String | |
| public static String | |
| public static String | |
| public static String | capitalizeFirst(String toCapitalize)
Make first character of String uppercase, and the rest lowercase. |
| public static boolean | |
| public static boolean | Returns: True if the given string does contain at least one whitespace character, False otherwiseThe string to check s)Checks if the given string contains any whitespace characters. |
| public static String[][] | Returns: The decoded String array.The encoded String to be decoded. value)Decodes an encoded double String array back into array form. |
| public static boolean | |
| public static boolean | |
| public static String | getCorrectFileName(String orgName, String defaultExtension)
extends the filename with a default Extension, if no Extension '.x' could be found |
| public static String | |
| public static List | |
| public static List | Returns: a list of wordsthe input text)Returns a list of words contained in the given text. |
| public static String | |
| public static int | Returns: the int value of strthe String holding an Integer value str)Optimized method for converting a String into an Integer From http://stackoverflow.com/questions/1030479/most-efficient-way-of-converting-string-to-integer-in-java |
| public static Optional | Returns: the int value of str or Optional.empty() if not possiblethe String holding an Integer value str)Optimized method for converting a String into an Integer From http://stackoverflow.com/questions/1030479/most-efficient-way-of-converting-string-to-integer-in-java |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | Returns: True, if the check was successful. False otherwise.The string to check toCheck)Checks if the given String has exactly one pair of surrounding curly braces Strings with escaped characters in curly braces at the beginning and end are respected, too |
| public static boolean | |
| public static boolean | isNotBlank(@Nullable String string)
Checks if a CharSequence is not empty (""), not null and not whitespace only. |
| public static boolean | |
| public static boolean | |
| public static String | |
| public static String | limitStringLength(String s, int
the maximum length of the string - <= 0 means no limit maxLength)Limits the length of a string to a maximum length. |
| public static String | |
| public static String | Returns: The resulting string after wrapping capitals.The string to modify. s)Wrap all uppercase letters, or sequences of uppercase letters, in curly braces. |
| public static String | Returns: A String with every special character (including the quoting character itself) quoted.The String which may contain special characters. toQuote, String A String containing all special characters except the quoting character itself, which is automatically quoted. specials, char The quoting character. quoteChar)Quote special characters. |
| public static String | |
| public static String | Returns: Returns a stringEncloses the given string with " if there is a space contained |
| public static String | Returns: A new String with braces removed.The String to analyze. s)This method looks for occurrences of capital letters enclosed in an arbitrary number of pairs of braces, e.g. "{AB}" or "{{T}}". |
| private static String | Returns: A new String with braces removed.The String to analyze. s)This method looks for occurrences of capital letters enclosed in one pair of braces, e.g. "{AB}". |
| public static String | |
| public static String | replaceSpecialCharacters(String s)
Replace non-English characters like umlauts etc. with a sensible letter or letter combination that bibtex can accept. |
| public static String | shaveString(String toShave)
Returns the string, after shaving off whitespace at the beginning and end, and removing (at most) one pair of braces or " surrounding it. |
| public static ArrayList | Returns: a list of tokensthe string to split path)Splits a string by whitespace, treating backslash-escaped spaces as part of the same token. |
| public static String | |
| public static String | |
| public static String | Returns: The in String, stripped of non-valid characters.The String whose non-valid characters we want to remove. in)This method ensures that the output String has only valid XML unicode characters as specified by the XML 1.0 standard. |
| public static String | |
| public static List | tokenizeToList(String
String to be tokenized buffer, String Delimiter string delimiter)Returns: list |
| public static String | Returns: a String with only OS.NEWLINE as line breaksReplaces all platform-dependent line breaks by OS.NEWLINE line breaks. |
| public static String | |
| public static String |
| BRACED_TITLE_CAPITAL_PATTERN | back to summary |
|---|---|
| private static final Pattern BRACED_TITLE_CAPITAL_PATTERN | |
| LINE_BREAKS | back to summary |
|---|---|
| private static final Pattern LINE_BREAKS | |
| NORMALIZE_PATTERN | back to summary |
|---|---|
| private static final Pattern NORMALIZE_PATTERN Pattern for normalizing whitespace and punctuation using named capture groups | |
| SPECIAL_COMMAND_CHARS | back to summary |
|---|---|
| public static final String SPECIAL_COMMAND_CHARS | |
| SPLIT_TEXT_PATTERN | back to summary |
|---|---|
| private static final Pattern SPLIT_TEXT_PATTERN | |
| STRING_TABLE_DELIMITER | back to summary |
|---|---|
| private static final String STRING_TABLE_DELIMITER | |
| UNICODE_CHAR_MAP | back to summary |
|---|---|
| private static final UnicodeToReadableCharMap UNICODE_CHAR_MAP | |
| WRAPPED_LINE_PREFIX | back to summary |
|---|---|
| private static final String WRAPPED_LINE_PREFIX | |
| StringUtil | back to summary |
|---|---|
| public StringUtil() | |
| addWrappedLine | back to summary |
|---|---|
| private static void addWrappedLine(StringBuilder result, String line, int wrapAmount, String newlineString) Appends a text to a string builder. Wraps the text so that each line is approx wrapAmount characters long. Wrapping is done using newline and tab character. | |
| alignStringTable | back to summary |
|---|---|
| public static String alignStringTable(List<Pair<String, String>> table) | |
| boldHTML | back to summary |
|---|---|
| public static String boldHTML(String input) Return string enclosed in HTML bold tags | |
| boldHTML | back to summary |
|---|---|
| public static String boldHTML(String input, String alternative) Return string enclosed in HTML bold tags if not null, otherwise return alternative text in HTML bold tags | |
| booleanToBinaryString | back to summary |
|---|---|
| public static String booleanToBinaryString(boolean expression) | |
| capitalizeFirst | back to summary |
|---|---|
| public static String capitalizeFirst(String toCapitalize) Make first character of String uppercase, and the rest lowercase. | |
| containsIgnoreCase | back to summary |
|---|---|
public static boolean containsIgnoreCase(String text, String searchString)
| |
| containsWhitespace | back to summary |
|---|---|
| public static boolean containsWhitespace(String s) Checks if the given string contains any whitespace characters. The supported whitespace characters
are the set of characters matched by
| |
| decodeStringDoubleArray | back to summary |
|---|---|
| public static String[][] decodeStringDoubleArray(String value) Decodes an encoded double String array back into array form. The array is assumed to be square, and delimited by the characters ';' (first dim) and ':' (second dim). | |
| endsWithIgnoreCase | back to summary |
|---|---|
public static boolean endsWithIgnoreCase(String string, String suffix)
| |
| equalsUnifiedLineBreak | back to summary |
|---|---|
| public static boolean equalsUnifiedLineBreak(Optional<String> stringOne, Optional<String> stringTwo) | |
| getCorrectFileName | back to summary |
|---|---|
| public static String getCorrectFileName(String orgName, String defaultExtension) extends the filename with a default Extension, if no Extension '.x' could be found | |
| getPart | back to summary |
|---|---|
| public static String getPart(String text, int startIndex, boolean terminateOnEndBraceOnly) Creates a substring from a text | |
| getStringAsSentences | back to summary |
|---|---|
| public static List Returns a list of sentences contained in the given text. | |
| getStringAsWords | back to summary |
|---|---|
| public static List Returns a list of words contained in the given text. Whitespace, comma and semicolon are considered as separator between words. | |
| ignoreCurlyBracket | back to summary |
|---|---|
| public static String ignoreCurlyBracket(String title) | |
| intValueOf | back to summary |
|---|---|
| public static int intValueOf(String str) Optimized method for converting a String into an Integer From http://stackoverflow.com/questions/1030479/most-efficient-way-of-converting-string-to-integer-in-java
| |
| intValueOfOptional | back to summary |
|---|---|
| public static Optional Optimized method for converting a String into an Integer From http://stackoverflow.com/questions/1030479/most-efficient-way-of-converting-string-to-integer-in-java | |
| isBlank | back to summary |
|---|---|
| public static boolean isBlank(@Nullable String string) | |
| isBlank | back to summary |
|---|---|
| public static boolean isBlank(@NonNull Optional<String> string) | |
| isInCitationMarks | back to summary |
|---|---|
| public static boolean isInCitationMarks(String toCheck) | |
| isInCurlyBrackets | back to summary |
|---|---|
| public static boolean isInCurlyBrackets(String toCheck) Checks if the given String has exactly one pair of surrounding curly braces Strings with escaped characters in curly braces at the beginning and end are respected, too
| |
| isInSquareBrackets | back to summary |
|---|---|
| public static boolean isInSquareBrackets(String toCheck) | |
| isNotBlank | back to summary |
|---|---|
| public static boolean isNotBlank(@Nullable String string) Checks if a CharSequence is not empty (""), not null and not whitespace only. | |
| isNotBlank | back to summary |
|---|---|
| public static boolean isNotBlank(Optional<String> string) | |
| isNullOrEmpty | back to summary |
|---|---|
| public static boolean isNullOrEmpty(@Nullable String toTest) | |
| join | back to summary |
|---|---|
| public static String join(String[] strings, String separator, int from, int to) Concatenate all strings in the array from index 'from' to 'to' (excluding to) with the given separator. Example: String[] s = "ab/cd/ed".split("/"); join(s, "\", 0, s.length) -> "ab\cd\ed"
| |
| limitStringLength | back to summary |
|---|---|
| public static String limitStringLength(String s, int maxLength) Limits the length of a string to a maximum length. Note the implementation is different from StringUtils.substring, because it accepts parameters smaller than 4.
| |
| makeSafe | back to summary |
|---|---|
| public static String makeSafe(@Nullable String string) | |
| putBracesAroundCapitals | back to summary |
|---|---|
| public static String putBracesAroundCapitals(String s) Wrap all uppercase letters, or sequences of uppercase letters, in curly braces. Ignore letters within a pair of # character, as these are part of a string label that should not be modified. | |
| quote | back to summary |
|---|---|
| public static String quote(String toQuote, String specials, char quoteChar) Quote special characters.
| |
| quoteForHTML | back to summary |
|---|---|
| public static String quoteForHTML(String toQuote) Quotes each and every character, e.g. '!' as !. Used for verbatim display of arbitrary strings that may contain HTML entities. | |
| quoteStringIfSpaceIsContained | back to summary |
|---|---|
| public static String quoteStringIfSpaceIsContained(String string) Encloses the given string with " if there is a space contained
| |
| removeBracesAroundCapitals | back to summary |
|---|---|
| public static String removeBracesAroundCapitals(String s) This method looks for occurrences of capital letters enclosed in an arbitrary number of pairs of braces, e.g. "{AB}" or "{{T}}". All of these pairs of braces are removed. | |
| removeSingleBracesAroundCapitals | back to summary |
|---|---|
| private static String removeSingleBracesAroundCapitals(String s) This method looks for occurrences of capital letters enclosed in one pair of braces, e.g. "{AB}". All these are replaced by only the capitals in between the braces. | |
| removeStringAtTheEnd | back to summary |
|---|---|
public static String removeStringAtTheEnd(String string, String stringToBeRemoved)
| |
| replaceSpecialCharacters | back to summary |
|---|---|
| public static String replaceSpecialCharacters(String s) Replace non-English characters like umlauts etc. with a sensible letter or letter combination that bibtex can accept. The basis for replacement is the HashMap UnicodeToReadableCharMap. | |
| shaveString | back to summary |
|---|---|
| public static String shaveString(String toShave) Returns the string, after shaving off whitespace at the beginning and end, and removing (at most) one pair of braces or " surrounding it. | |
| splitRespectingEscapedWhitespace | back to summary |
|---|---|
| public static ArrayList Splits a string by whitespace, treating backslash-escaped spaces as part of the same token. Example: | |
| stripAccents | back to summary |
|---|---|
public static String stripAccents(String searchQuery)
| |
| stripBrackets | back to summary |
|---|---|
| public static String stripBrackets(String toStrip) Removes optional square brackets from the string s | |
| stripNonValidXMLCharacters | back to summary |
|---|---|
| public static String stripNonValidXMLCharacters(String in) This method ensures that the output String has only valid XML unicode characters as specified by the XML 1.0 standard. For reference, please see the standard. This method will return an empty String if the input is null or empty. URL: http://cse-mjmcl.cse.bris.ac.uk/blog/2007/02/14/1171465494443.html | |
| substringBetween | back to summary |
|---|---|
| public static String substringBetween(String str, String open, String close) | |
| tokenizeToList | back to summary |
|---|---|
public static List
| |
| unifyLineBreaks | back to summary |
|---|---|
| public static String unifyLineBreaks(String s, String newline) Replaces all platform-dependent line breaks by OS.NEWLINE line breaks. AKA normalize newlines We do NOT use UNIX line breaks as the user explicitly configures its linebreaks and this method is used in bibtex field writing Example```text Legacy Macintosh \r -> OS.NEWLINE Windows \r\n -> OS.NEWLINE ```
| |
| unquote | back to summary |
|---|---|
| public static String unquote(String toUnquote, char quoteChar) Unquote special characters. | |
| wrap | back to summary |
|---|---|
| public static String wrap(String in, int wrapAmount, String newline) Formats field contents for output. Must be "symmetric" with the parse method above, so stored and reloaded fields are not mangled. | |