Class StringToolUnit

java.lang.Object
ch.nolix.base.commontypetool.stringtool.StringToolUnit
All Implemented Interfaces:
IStringTool

public final class StringToolUnit extends Object implements IStringTool
The StringToolUnit provides methods to handle Strings.
Author:
Silvan Wyss
  • Constructor Details

    • StringToolUnit

      public StringToolUnit()
  • Method Details

    • createStringWithoutLastCharacters

      public String createStringWithoutLastCharacters(String string, int n)
      Specified by:
      createStringWithoutLastCharacters in interface IStringTool
      Parameters:
      string -
      n -
      Returns:
      a new String that is like the given string without the last n characters.
    • createTabs

      public String createTabs(int tabCount)
      Specified by:
      createTabs in interface IStringTool
      Parameters:
      tabCount -
      Returns:
      a new String consisting of as many tabulators as the given tabCount says.
    • getInBraces

      public String getInBraces(Object object)
      Specified by:
      getInBraces in interface IStringTool
      Parameters:
      object -
      Returns:
      the String representation of the given object in braces.
    • getInParentheses

      public String getInParentheses(Object... objects)
      Specified by:
      getInParentheses in interface IStringTool
      Parameters:
      objects -
      Returns:
      the String representation of the given objects in parentheses.
    • getInSingleQuotes

      public String getInSingleQuotes(Object object)
      Specified by:
      getInSingleQuotes in interface IStringTool
      Parameters:
      object -
      Returns:
      the String representation of the given object in single quotes.
    • toBoolean

      public boolean toBoolean(String string)
      Specified by:
      toBoolean in interface IStringTool
      Parameters:
      string -
      Returns:
      the boolean the given string represents.
    • toCapitalSnakeCase

      public String toCapitalSnakeCase(String string)
      Specified by:
      toCapitalSnakeCase in interface IStringTool
      Parameters:
      string -
      Returns:
      a new String in capital snake case for the given string.
    • toDouble

      public double toDouble(String string)
      Specified by:
      toDouble in interface IStringTool
      Parameters:
      string -
      Returns:
      the double the given string represents.
    • toPascalCase

      public String toPascalCase(String string)
      Specified by:
      toPascalCase in interface IStringTool
      Parameters:
      string -
      Returns:
      a new String in pascal case for the given string.
    • toProportion

      public double toProportion(String string)
      Specified by:
      toProportion in interface IStringTool
      Parameters:
      string -
      Returns:
      a proportion in [0, 1] from the given string.