Klasse StringTool

java.lang.Object
ch.nolix.core.commontypetool.stringtool.StringTool

public final class StringTool extends Object
The StringTool provides methods to handle Strings. Of the StringTool an instance cannot be created.
Version:
2025-03-09
Autor:
Silvan Wyss
  • Methodendetails

    • createStringWithoutLastCharacters

      public static String createStringWithoutLastCharacters(String string, int n)
      Parameter:
      string -
      n -
      Gibt zurück:
      a new String that is like the given string without the last n characters.
    • createTabs

      public static String createTabs(int tabCount)
      Parameter:
      tabCount -
      Gibt zurück:
      a new String consisting of as many tabulators as the given tabCount says.
      Löst aus:
      RuntimeException - if the given tabCount is negative.
    • getInBraces

      public static String getInBraces(Object object)
      Parameter:
      object -
      Gibt zurück:
      the String representation of the given object in braces.
      Löst aus:
      RuntimeException - if the given object is null.
    • getInParentheses

      public static String getInParentheses(Object object, Object... objects)
      Parameter:
      object -
      objects -
      Gibt zurück:
      the String representation of the given object and objects in parentheses.
      Löst aus:
      RuntimeException - if the given object is null.
      RuntimeException - if the given objects is null.
      RuntimeException - if one of the given objects is null.
    • getInSingleQuotes

      public static String getInSingleQuotes(Object object)
      Parameter:
      object -
      Gibt zurück:
      the String representation of the given object in single quotes.
      Löst aus:
      RuntimeException - if the given object is null.
    • toBoolean

      public static boolean toBoolean(String string)
      Parameter:
      string -
      Gibt zurück:
      the boolean the given string represents.
      Löst aus:
      RuntimeException - if the given string does not represent a boolean.
    • toCapitalSnakeCase

      public static String toCapitalSnakeCase(String string)
      Parameter:
      string -
      Gibt zurück:
      a new String in capital snake case for the given string.
    • toDouble

      public static double toDouble(String string)
      Parameter:
      string -
      Gibt zurück:
      the double the given string represents.
      Löst aus:
      RuntimeException - if the given string does not represent a double.
    • toPascalCase

      public static String toPascalCase(String string)
      Parameter:
      string -
      Gibt zurück:
      a new String in pascal case for the given string.