You need to sign in to do that
Don't have an account?
How to check if input string is valid decimal same way isNumeric checks input string is valid integer number?
Hi All,
In my apex code I need to check if an input string from CSV file is a valid number. It can be a integer or decimal value.
isNumeric only returns true if the input is integer but does not work for decimal.
Is there an easy way to determine if an input string from CSV file is a valid decimal or integer ?
In my apex code I need to check if an input string from CSV file is a valid number. It can be a integer or decimal value.
isNumeric only returns true if the input is integer but does not work for decimal.
Is there an easy way to determine if an input string from CSV file is a valid decimal or integer ?
String numeric = '1234567890'; system.debug(numeric.isNumeric()); String decimalPoint = '1.2'; system.debug(decimalPoint.isNumeric()); Logs Displays: true flase
You can check like below,
All Answers
You can check like below,