Class StringHelper
java.lang.Object
com.marginallyclever.convenience.helpers.StringHelper
A collection of static methods to help with strings.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
byteArrayToFloat
(byte[] bytes) static boolean
confirmChecksumOK
(String msg) static byte[]
floatToByteArray
(double value) static String
formatDouble
(double arg0) static String
formatFloat
(float arg0) static String
formatTime
(double seconds) static String
generateChecksum
(String msg) static javax.vecmath.Matrix3d
static javax.vecmath.Matrix4d
static double
parseNumber
(String str) Parse a number sent from a US format systemstatic javax.vecmath.Tuple3d
static String
-
Constructor Details
-
StringHelper
public StringHelper()
-
-
Method Details
-
shortenNumber
-
formatFloat
-
formatDouble
-
parseNumber
Parse a number sent from a US format system- Parameters:
str
-- Returns:
-
generateChecksum
-
confirmChecksumOK
-
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
- Parameters:
seconds
- time in seconds- Returns:
- formatted string
-
parseTuple3d
- Throws:
IOException
-
parseMatrix3d
- Throws:
Exception
-
parseMatrix4d
- Throws:
Exception
-