AnsweredAssumed Answered

split function not working for punctuation mark?

Question asked by e-no91 on Jul 23, 2014
Latest reply on Jul 23, 2014 by e-no91
I have this code in my js script to run when a rule is triggered.

var docName = (document.name).toString();
var name = docName.split(".");
logger.log(docName);
logger.log(name[0]);


The document name is "Testfrom muatturun - Copy (7).txt"

I expected the split function to return name[0] as "Testfrom muatturun - Copy (7)".
But it returns "undefined" instead.

What is the correct way to do this?

Thank you in advance!

Outcomes