Pas2JS pascal source code
WriteLn(StrSplit('a,b', ',')[1]);
var s := 'a,b';
WriteLn(StrSplit(s, ',')[0]);
var k := 1;
WriteLn(StrSplit(s, ',')[k]);
{ <<< CONSOLE OUTPUTS >>>
b
a
b
}
var s = "";
var k = 0;
WriteLn(("a,b").split(",")[1]);
s = "a,b";
WriteLn((s).split(",")[0]);
k = 1;
WriteLn((s).split(",")[k]);