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:

    return v.split('\\|')[0];

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

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.