Search code examples
javatalend

Talend studio isNumeric()


I am learning talend open studio and I want to put this line of code :

boolean numeric = isNumeric(input_row.id);

In tjavaroW, but when I run the job it throws me an error:

isNumeric is an undefined method

. Please can you tell me how to solve this problem?

Thanks a lot.


Solution

  • You can check.. if the input is numeric or not using below piece of code at tJavaRow

    boolean isNumeric=true;
    try{
        Integer i = Integer.parseInt(input_row.id);
    } catch(Exception ex){
        isNumeric = false;
    }