Interface IStringTool
- All Known Implementing Classes:
StringToolUnit
public interface IStringTool
The
IStringTool provides methods to handle Strings.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptioncreateStringWithoutLastCharacters(String string, int n) createTabs(int tabCount) getInBraces(Object object) getInParentheses(Object... objects) getInSingleQuotes(Object object) booleantoCapitalSnakeCase(String string) doubletoPascalCase(String string) doubletoProportion(String string)
-
Method Details
-
createStringWithoutLastCharacters
- Parameters:
string-n-- Returns:
- a new
Stringthat is the given string without the last n characters - Throws:
RuntimeException- if the given string is nullRuntimeException- if the given n is negative or bigger than the length of the given string
-
createTabs
- Parameters:
tabCount-- Returns:
- a new
Stringconsisting of as many tabulators as the given tabCount says - Throws:
RuntimeException- if the given tabCount is negative
-
getInBraces
-
getInParentheses
-
getInSingleQuotes
-
toBoolean
- Parameters:
string-- Returns:
- the boolean the given string represents
- Throws:
RuntimeException- if the given string does not represent a boolean
-
toCapitalSnakeCase
-
toDouble
- Parameters:
string-- Returns:
- the double the given string represents.
- Throws:
RuntimeException- if the given string does not represent a double
-
toPascalCase
-
toProportion
- Parameters:
string-- Returns:
- a proportion in [0, 1] from the given string.
- Throws:
RuntimeException- if the given string does not represent a proportion
-