java.lang.Object
com.marginallyclever.convenience.helpers.StringHelper

public class StringHelper extends Object
A collection of static methods to help with strings.
  • Constructor Details

    • StringHelper

      public StringHelper()
  • Method Details

    • shortenNumber

      public static String shortenNumber(String s)
    • formatFloat

      public static String formatFloat(float arg0)
    • formatDouble

      public static String formatDouble(double arg0)
    • parseNumber

      public static double parseNumber(String str)
      Parse a number sent from a US format system
      Parameters:
      str -
      Returns:
    • generateChecksum

      public static String generateChecksum(String msg)
    • confirmChecksumOK

      public static boolean confirmChecksumOK(String msg)
    • floatToByteArray

      public static byte[] floatToByteArray(double value)
      Parameters:
      value -
      Returns:
      byte array
    • byteArrayToFloat

      public static double byteArrayToFloat(byte[] bytes)
      Parameters:
      bytes - byte array
      Returns:
      double value
    • formatTime

      public static String formatTime(double seconds)
      Parameters:
      seconds - time in seconds
      Returns:
      formatted string
    • parseTuple3d

      public static javax.vecmath.Tuple3d parseTuple3d(String s) throws IOException
      Throws:
      IOException
    • parseMatrix3d

      public static javax.vecmath.Matrix3d parseMatrix3d(String s) throws Exception
      Throws:
      Exception
    • parseMatrix4d

      public static javax.vecmath.Matrix4d parseMatrix4d(String s) throws Exception
      Throws:
      Exception