Stupid string stuff

Just posting it here so I have a place to refer to than Google every time.

Got an array of elements.

I want to join these with double quotes around each. That is, I want "1","2","3",...

Option 1

This joins the array elements with “,” and then adds a ” to the beginning of the first element and end of the last element.

Option 2

Same idea as above, but I add the ” a different way to the beginning and end. Neater looking method.

If you want to add curly braces within the '"{0}"' add them twice. Example: '"{{ {0} }}"'

Option 3

This one adds “s to each array element, then joins them with commas. :)

Something else

I like this last method coz I can easily change it to add newlines too.

Can do with others too, but since I am using single quotes I’ll have to change that. For example:

Too many double quotes in there. :) I have to add it twice to escape it within the outer double quotes.