Class StringToolUnit
java.lang.Object
ch.nolix.base.commontypetool.stringtool.StringToolUnit
- All Implemented Interfaces:
IStringTool
The
StringToolUnit provides methods to handle Strings.- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
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)
-
Constructor Details
-
StringToolUnit
public StringToolUnit()
-
-
Method Details
-
createStringWithoutLastCharacters
- Specified by:
createStringWithoutLastCharactersin interfaceIStringTool- Parameters:
string-n-- Returns:
- a new
Stringthat is like the given string without the last n characters.
-
createTabs
- Specified by:
createTabsin interfaceIStringTool- Parameters:
tabCount-- Returns:
- a new
Stringconsisting of as many tabulators as the given tabCount says.
-
getInBraces
- Specified by:
getInBracesin interfaceIStringTool- Parameters:
object-- Returns:
- the
Stringrepresentation of the given object in braces.
-
getInParentheses
- Specified by:
getInParenthesesin interfaceIStringTool- Parameters:
objects-- Returns:
- the
Stringrepresentation of the given objects in parentheses.
-
getInSingleQuotes
- Specified by:
getInSingleQuotesin interfaceIStringTool- Parameters:
object-- Returns:
- the
Stringrepresentation of the given object in single quotes.
-
toBoolean
- Specified by:
toBooleanin interfaceIStringTool- Parameters:
string-- Returns:
- the boolean the given string represents.
-
toCapitalSnakeCase
- Specified by:
toCapitalSnakeCasein interfaceIStringTool- Parameters:
string-- Returns:
- a new
Stringin capital snake case for the given string.
-
toDouble
- Specified by:
toDoublein interfaceIStringTool- Parameters:
string-- Returns:
- the double the given string represents.
-
toPascalCase
- Specified by:
toPascalCasein interfaceIStringTool- Parameters:
string-- Returns:
- a new
Stringin pascal case for the given string.
-
toProportion
- Specified by:
toProportionin interfaceIStringTool- Parameters:
string-- Returns:
- a proportion in [0, 1] from the given string.
-