Package net.dermetfan.utils
Class StringUtils
java.lang.Object
net.dermetfan.utils.StringUtils
utility methods for operations on Strings
- Since:
- 0.6.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic intstatic intstatic intstatic intsame ascountwithout overlapping occurrencesstatic intstatic intsame ascountwithout overlapping occurrencesstatic intstatic booleanisJavaIdentifierPart(char c) for GWT compatibilitystatic booleanisJavaIdentifierPart(int codePoint) for GWT compatibilitystatic booleanisJavaIdentifierStart(char c) for GWT compatibilitystatic booleanisJavaIdentifierStart(int codePoint) for GWT compatibilitystatic Stringstatic Stringstatic Stringstatic Stringstatic StringtoJavaIdentifier(String string)
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
toJavaIdentifier
- Parameters:
string- the String to convert to a valid java identifier, as far as possible
-
isJavaIdentifierStart
public static boolean isJavaIdentifierStart(char c) for GWT compatibility- See Also:
-
isJavaIdentifierStart
public static boolean isJavaIdentifierStart(int codePoint) for GWT compatibility- See Also:
-
isJavaIdentifierPart
public static boolean isJavaIdentifierPart(char c) for GWT compatibility- See Also:
-
isJavaIdentifierPart
public static boolean isJavaIdentifierPart(int codePoint) for GWT compatibility- See Also:
-
replace
- Parameters:
index- the index of the character to replacereplacement- the replacement for the character at the given indexstring- the String in which to replace- Returns:
- a representation of the given String with the contents replaced
-
replace
- See Also:
-
remove
- Parameters:
beginIndex- the index of the first character to removeendIndex- the index at which to stop the removalstring- the String from which to remove- Returns:
- a representation of the given String with contents removed
-
remove
- See Also:
-
count
public static int count(String target, String string, int beginIndex, int endIndex, boolean overlap) - Parameters:
overlap- if occurrences are allowed to overlap- See Also:
-
count
same ascountwithout overlapping occurrences- See Also:
-
count
- See Also:
-
count
same ascountwithout overlapping occurrences- See Also:
-
count
- Parameters:
c- the character to countstring- the String in which to count- Returns:
- the number of occurrences of c in string in the range from beginIndex to endIndex
-
count
- See Also:
-
count
- See Also:
-
count
- See Also:
-