in reply to set context for method's return values

I think you just need to correctly place the brackets:

print((split(",", "A,B,C,D"))[2]);