Handling "null" and “” or ‘’ or ‘ values.

One Star

Handling "null" and “” or ‘’ or ‘ values.

Hi,
I have used a input field (String) and wants to validate the field
in Tmap component - (Java project)
How to validate and replace the value 0 if null or ?? or ?? or ? values comes for that particular field in input.
Please let me know your pointers and updates.
Using the below expression i can able to check the null condition alone but not the
?? or ?? or ? values in input
row1.T_amount == null? "0" : row1.T_amount;
Thanks and regards,
Manikandan.R
Community Manager

Re: Handling "null" and “” or ‘’ or ‘ values.

Hello guy
try
row1.T_amount.equals("\"\"")? "0" : row1.T_amount    //for ""

row1.T_amount.equals("\'\'")? "0" : row1.T_amount    //for ''

row1.T_amount.equals("\'")? "0" : row1.T_amount    //for '

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Handling "null" and “” or ‘’ or ‘ values.

The above solutions leads to Java error.
Please let me know if any other ways to handle the special charecters.
Thanks and Regards,
Mani.
Community Manager

Re: Handling "null" and “” or ‘’ or ‘ values.

Hello
What's the java error message?
Can you show us your source file?
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business