Why .split("|") returns wrong result?

Why output = “1”?

var String output = "01|03|02|08|a1"
output = output.split("|").get(1)

Thank you!

output = output.split("\\|").get(1)
1 Like

Why it does not work in JS transformation? :grinning_face_with_smiling_eyes:

(function(v){
    return v.split('\\|')[0];
})
(input)

In rules - it’s ok

Because now you are working with a javascript string and its methods. This is a different thing to a Java string and its methods.

1 Like