In order to get the content inside the Parenthesis of a whole String, we can use the below code.
In Talend you can use the below code :
(!(Relational.ISNULL(row2.Consequence)) && !(row2.Consequence.toString().isEmpty())) ? (row2.Consequence.split("\\(")[1]).split("\\)")[0] : null;
String : (AMITABH) BACCHAN
Output : AMITABH
public class HelloWorld {
public static void main(String[] args) {
String str = "jhjh (Environment) ab-
ghty";
System.out.println((str.split("\\(")[1]).split("\\)")[0]);
}
}
In Talend you can use the below code :
(!(Relational.ISNULL(row2.Consequence)) && !(row2.Consequence.toString().isEmpty())) ? (row2.Consequence.split("\\(")[1]).split("\\)")[0] : null;
String : (AMITABH) BACCHAN
Output : AMITABH