Package org.mariuszgromada.math.mxparser
Class StringUtils
java.lang.Object
org.mariuszgromada.math.mxparser.StringUtils
A class containing all string utils.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcountLines(String text) static intcountOccurrences(String str, String toFind) static StringhexString2AsciiString(String hexString) Converts hex string into ASCII string, where each letter is represented by two hex digits (byte) from the hex string.static StringnumberToAsciiString(double number) Converts (long)double number into ASCII string, where each letter is represented by two hex digits (byte) from the hex representation of the original number cast to long type.static StringnumberToAsciiString(int number) Converts number into ASCII string, where each letter is represented by two hex digits (byte) from the hex representation of the original numberstatic StringnumberToAsciiString(long number) Converts number into ASCII string, where each letter is represented by two hex digits (byte) from the hex representation of the original numberstatic StringnumberToHexString(double number) Converts (long)double number to hex string (plain text)static StringnumberToHexString(int number) Converts integer number to hex string (plain text)static StringnumberToHexString(long number) Converts long number to hex string (plain text)static booleanregexMatch(String str, String pattern) Function used to introduce some compatibility between JAVA and C# while regexp matching.
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
regexMatch
Function used to introduce some compatibility between JAVA and C# while regexp matching.- Parameters:
str- Stringpattern- Pattern (regexp)- Returns:
- True if pattern matches entirely, False otherwise
-
numberToHexString
Converts integer number to hex string (plain text)- Parameters:
number- Integer number- Returns:
- Hex string (i.e. FF23)
-
numberToHexString
Converts long number to hex string (plain text)- Parameters:
number- Long number- Returns:
- Hex string (i.e. FF23)
-
numberToHexString
Converts (long)double number to hex string (plain text)- Parameters:
number- Double number- Returns:
- Hex string (i.e. FF23)
-
hexString2AsciiString
Converts hex string into ASCII string, where each letter is represented by two hex digits (byte) from the hex string.- Parameters:
hexString- Hex string (i.e. 48656C6C6F)- Returns:
- ASCII string (i.e. '48656C6C6F' = 'Hello')
-
numberToAsciiString
Converts number into ASCII string, where each letter is represented by two hex digits (byte) from the hex representation of the original number- Parameters:
number- Integer number (i.e. 310939249775 = '48656C6C6F')- Returns:
- ASCII string (i.e. '48656C6C6F' = 'Hello')
-
numberToAsciiString
Converts number into ASCII string, where each letter is represented by two hex digits (byte) from the hex representation of the original number- Parameters:
number- Long number (i.e. 310939249775 = '48656C6C6F')- Returns:
- ASCII string (i.e. '48656C6C6F' = 'Hello')
-
numberToAsciiString
Converts (long)double number into ASCII string, where each letter is represented by two hex digits (byte) from the hex representation of the original number cast to long type.- Parameters:
number- Double number (i.e. 310939249775 = '48656C6C6F')- Returns:
- ASCII string (i.e. '48656C6C6F' = 'Hello')
-
countOccurrences
-
countLines
-