Package jme3utilities

Class MyString

java.lang.Object
jme3utilities.MyString

public final class MyString extends Object
Utility methods for char sequences, strings, and collections of strings.
  • Method Details

    • axisName

      public static String axisName(int axisIndex)
      Describe a coordinate axis.
      Parameters:
      axisIndex - the index of the axis: 0→X, 1→Y, 2→Z
      Returns:
      a textual description (not null, not empty)
    • describe

      public static String describe(float fValue)
      Generate a textual description of a single-precision floating-point value.
      Parameters:
      fValue - the value to describe
      Returns:
      a description (not null, not empty)
    • describeFraction

      public static String describeFraction(float fValue)
      Generate a textual description of a single-precision floating-point value using at most 3 decimal places.
      Parameters:
      fValue - the value to describe
      Returns:
      a description (not null, not empty)
    • describeMatrix

      public static String describeMatrix(Matrix3f matrix)
      Generate a textual description of a Matrix3f value.
      Parameters:
      matrix - the value to describe (may be null, unaffected)
      Returns:
      a description (not null, not empty)
    • escape

      public static String escape(CharSequence unescaped)
      Replace all tab, quote, newline, and backslash characters in the specified text with escape sequences.
      Parameters:
      unescaped - the input text to escape (not null)
      Returns:
      the escaped text (not null)
    • firstToLower

      public static String firstToLower(String input)
      Convert the first character of the specified text to lower case.
      Parameters:
      input - the input text to convert (not null)
      Returns:
      the converted text (not null)
    • quote

      public static String quote(CharSequence text)
      Enclose the specified text in quotation marks and escape all tab, quote, newline, and backslash characters.
      Parameters:
      text - the input text to quote
      Returns:
      the quoted text, or "null" if the input was null
    • removeSuffix

      public static String removeSuffix(String input, String suffix)
      Extract the remainder of the specified string after removing the specified suffix.
      Parameters:
      input - the input string (not null)
      suffix - the suffix string (not null)
      Returns:
      the remainder of the input (not null)