How to verify if a string contains at least two numbers in Talend?

547 Views Asked by At

Does anybody know how to verify if a string contains at least two numbers in Talend using the Tmap component?

Example: The string "46 W Street, New York, NY 10033" is true since I have "46" and "10033"

2

There are 2 best solutions below

0
Amine Ben Khelifa On BEST ANSWER

In the var section : - Declare a variable called checkNumber that have type a boolean

That have as value

row1.YourString.matches(".*\\d.*") ? true : false
1
Joshua On

I think i found how to do what you want, you can go to the java api link :https://docs.oracle.com/javase/7/docs/api/java/lang/String.html here you can find the contains methode wich return a boolean if there are the characters.