I have operator and value as string. When my operator equal to '>' or '<' then i need to ensure the value of the string is numeric or Decimal so it can wrk for both. But i see only isNumeric() ? Any idea
String operator = '<';
String value = '3.14';
if(operator.equals('<') && operator.isNumeric() || //Check operator isDecimal)
{
//Process criteria
}
I am thinking in such a way below
try{
Double value = Decimal.valueOf('1234a');
}
catch(exception ex)
{
system.debug('Not a number');
//process further
}
But didn't feel ts opt. Suggest me!