I have to write the condition in Java, which will check whether the variable ends with the characters '-1'. If so let assign another variable value of '1', if not '2'.
I do not know Java, but I wrote something like this...
var adres = 'something@something.com-1';
if ( adres.contains("-1") ) {
{ var someVariable = '1' };
} else {
{ var someVariable = '2' };
}
The script does not work. In addition, the "contains" is not the best solution, because the address might look like this: 'something@something.com-12'.
I will be grateful for your help.