Package org.mariuszgromada.math.mxparser
Class StringUtils
- java.lang.Object
-
- org.mariuszgromada.math.mxparser.StringUtils
-
public final class StringUtils extends Object
A class containing all string utils.- Version:
- 5.2.0
- Author:
- Mariusz Gromada
MathParser.org - mXparser project page
mXparser on GitHub
INFIMA place to purchase a commercial MathParser.org-mXparser software license
info@mathparser.org
ScalarMath.org - a powerful math engine and math scripting language
Scalar Lite
Scalar Pro
MathSpace.pl
Buy me a cup of coffee via donation
or support me purchasing the license via ORDER Page , or INFIMA online store
-
-
Constructor Summary
Constructors Constructor Description StringUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
countLines(String text)
static int
countOccurrences(String str, String toFind)
static String
hexString2AsciiString(String hexString)
Converts hex string into ASCII string, where each letter is represented by two hex digits (byte) from the hex string.static String
numberToAsciiString(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 String
numberToAsciiString(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 String
numberToAsciiString(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 String
numberToHexString(double number)
Converts (long)double number to hex string (plain text)static String
numberToHexString(int number)
Converts integer number to hex string (plain text)static String
numberToHexString(long number)
Converts long number to hex string (plain text)static boolean
regexMatch(String str, String pattern)
Function used to introduce some compatibility between JAVA and C# while regexp matching.
-
-
-
Method Detail
-
regexMatch
public static boolean regexMatch(String str, String pattern)
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
public static String numberToHexString(int number)
Converts integer number to hex string (plain text)- Parameters:
number
- Integer number- Returns:
- Hex string (i.e. FF23)
-
numberToHexString
public static String numberToHexString(long number)
Converts long number to hex string (plain text)- Parameters:
number
- Long number- Returns:
- Hex string (i.e. FF23)
-
numberToHexString
public static String numberToHexString(double number)
Converts (long)double number to hex string (plain text)- Parameters:
number
- Double number- Returns:
- Hex string (i.e. FF23)
-
hexString2AsciiString
public static String hexString2AsciiString(String hexString)
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
public static String numberToAsciiString(int number)
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
public static String numberToAsciiString(long number)
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
public static String numberToAsciiString(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.- Parameters:
number
- Double number (i.e. 310939249775 = '48656C6C6F')- Returns:
- ASCII string (i.e. '48656C6C6F' = 'Hello')
-
countLines
public static int countLines(String text)
-
-