Just playing with Oxygene and tried to concatenate strings and an int (args.length). Guessed it was + and was waiting for an error on doing: “there were " + args.length + " arguments passed in”. But the args.length was automatically converted to a string.
My question is where in the documentation would I have found what the string concatenation operator is? I found “Binary Operator Expressions”, but the concatenation operator is not listed there:
Good question; It seems we don’t have that in docs.
I’ve reported an issue to document this. The way it works is fairly simple, normally we use the operator methods for a type, but string as special; in this case the compiler calls:
Which has overloads for (String, String), (String, Object) and (Object, String)… The end effect is that the value is boxed and ToString is called on it to get the string value. (Same logic applies on our other platforms).
to join to a string, you can use x.ToList.JoinedString(joiner). I’ll add JoinedString to sequence as well, so the ToList() can be dropped (been meaning to do that for a while).