Package com.microstrategy.utils
Class NumberParser
- java.lang.Object
-
- com.microstrategy.utils.NumberParser
-
public class NumberParser extends java.lang.Object
This class is intended to parse a string into a number based on Locale. Callers of this class should not pass innull
String, otherwise java.lang.NullPointerException is thrown.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Constructor Summary
Constructors Constructor Description NumberParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isNumber(java.lang.String str, java.util.Locale locale)
Returns true if the string is a number in the specified locale.static java.lang.String
stripWhiteSpaces(java.lang.String str, java.util.Locale locale)
Strip off the white space characters within the string if the locale is French or Swedish only, otherwise returns the original string.
-
-
-
Method Detail
-
isNumber
public static boolean isNumber(java.lang.String str, java.util.Locale locale)
Returns true if the string is a number in the specified locale. In case of French and Swedish language, all the white space characters contained within the string are ignored. In other languages, keep the string as is when parsing.- Parameters:
str
- the string to parselocale
- the java.lang.Locale- Returns:
- true if the string is a number in the specified locale.
-
stripWhiteSpaces
public static java.lang.String stripWhiteSpaces(java.lang.String str, java.util.Locale locale)
Strip off the white space characters within the string if the locale is French or Swedish only, otherwise returns the original string.- Parameters:
str
- the string whose white space characters needs to be strippedlocale
- the java.util.Locale- Returns:
- a new string with white space charaters free.
-
-