java.lang.Object
org.apache.jena.atlas.lib.StrUtils
Some functions that act on strings
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]static Stringstatic final booleanDoes one string contain another string?static StringDecode a string using marked hex values e.g.static StringEncode a string using hex values e.g.static Stringstatic StringfromUTF8bytes(byte[] bytes) static Stringstatic final Stringstatic String[]Split but also trim whiespace.static Stringstatic intstrCompare(String s1, String s2) static intstrCompareIgnoreCase(String s1, String s2) static booleanstrEndsWithIgnoreCase(String str, String suffix) static Stringstatic <X> StringConcatenate stringified objects, using a separator.static Stringstrjoin with a newline as the separatorstatic Stringstrjoin with a newline as the separatorstatic booleanstrStartsWithIgnoreCase(String str, String prefix) static Stringsubstitute(String str, Map<String, String> subs) toCharList(String str) static String
-
Field Details
-
CMP_GREATER
public static final int CMP_GREATER- See Also:
-
CMP_EQUAL
public static final int CMP_EQUAL- See Also:
-
CMP_LESS
public static final int CMP_LESS- See Also:
-
CMP_UNEQUAL
public static final int CMP_UNEQUAL- See Also:
-
CMP_INDETERMINATE
public static final int CMP_INDETERMINATE- See Also:
-
-
Method Details
-
strjoinNL
strjoin with a newline as the separator -
strjoinNL
strjoin with a newline as the separator -
strjoin
Concatenate stringified objects, using a separator. -
strCompare
-
strCompareIgnoreCase
-
strStartsWithIgnoreCase
-
strEndsWithIgnoreCase
-
asUTF8bytes
-
fromUTF8bytes
-
str
- Parameters:
x-- Returns:
- <null> if x == null, otherwise, x.toString()
-
split
Split but also trim whiespace. -
contains
Does one string contain another string?- Parameters:
str1-str2-- Returns:
- true if str1 contains str2
-
replace
-
substitute
-
strform
-
chop
-
noNewlineEnding
-
toCharList
-
encodeHex
Encode a string using hex values e.g. %20. Encoding only deals with single byte codepoints.- Parameters:
str- String to encodemarker- Marker characterescapees- Characters to encode (must include the marker)- Returns:
- Encoded string (returns input object if no change)
-
decodeHex
Decode a string using marked hex values e.g. %20. Multi-byte UTF-8 codepoints are handled.- Parameters:
str- String to decode.marker- The marker character- Returns:
- Decoded string (returns input object if no change)
-
escapeString
-
unescapeString
-