java.lang.Object
org.eclipse.jgit.ignore.internal.Strings
Various
String
related utility methods, written mostly to
avoid generation of new String objects (e.g. via splitting Strings etc).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isDirectoryPattern
(String pattern) Check if pattern is a directory pattern ending with a path separatorSplits given string to substrings by given separatorstatic String
stripTrailing
(String pattern, char c) Strip trailing charactersstatic String
stripTrailingWhitespace
(String pattern) Strip trailing whitespace characters
-
Constructor Details
-
Strings
public Strings()
-
-
Method Details
-
stripTrailing
Strip trailing characters- Parameters:
pattern
- non nullc
- character to remove- Returns:
- new string with all trailing characters removed
-
stripTrailingWhitespace
Strip trailing whitespace characters- Parameters:
pattern
- non null- Returns:
- new string with all trailing whitespace removed
-
isDirectoryPattern
Check if pattern is a directory pattern ending with a path separator- Parameters:
pattern
- non null- Returns:
true
if the last character, which is not whitespace, is a path separator
-
split
Splits given string to substrings by given separator- Parameters:
pattern
- non nullslash
- separator char- Returns:
- list of substrings
-