Class StringUtil
java.lang.Object
org.apache.tinkerpop.gremlin.util.StringUtil
Utility class for Strings.
- Author:
- Andrea Child
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanDetermines whether the given string is a syntactically valid Java identifier, to the same effect asjavax.lang.model.SourceVersion#isIdentifier(CharSequence)without requiring thejava.compilermodule.Splits the provided string into a List of string by the given separator, which will not be included in the returned List.
-
Method Details
-
split
Splits the provided string into a List of string by the given separator, which will not be included in the returned List.- Parameters:
toSplit- the string to splitseparator- the separator string to split by - empty will split into a List of characters- Returns:
- a List of parsed strings, not including the given separator
-
isIdentifier
Determines whether the given string is a syntactically valid Java identifier, to the same effect asjavax.lang.model.SourceVersion#isIdentifier(CharSequence)without requiring thejava.compilermodule. A string is a valid identifier if it is non-empty, its first code point satisfiesCharacter.isJavaIdentifierStart(int), and every other code point satisfiesCharacter.isJavaIdentifierPart(int). UnlikeSourceVersion.isName(), reserved keywords are not rejected.- Parameters:
s- the string to test- Returns:
trueifsis a valid Java identifier
-