How to display multiple strings.

Started by Twisted, Tue 26/10/2010 23:47:41

Previous topic - Next topic

Twisted

Could someone explain to me how to post multiple strings?
example: string name1 = "Bob";
                string name2 = "Bill";

Display("Hello "  name1 " and" name2);

I'm not sure how to script it but I hope this gives you an idea of what I'm trying to accomplish.

Matti

Display("Hello %s and %s", name1 , name2);

Twisted

Thanks for the quick reply. It works perfect now.

Matti


cianty

You may also need String.Format if you want to use variables in strings at some point.
ca. 70% completed

monkey0506

On that note, if the manual shows "..." as the final parameter of a function, then it supports "String formatting" (look that up in the manual for further descriptions of what all you can do with it). Otherwise, it doesn't, but as was said you can use String.Format and pass the result as a parameter to any functions that don't.

SMF spam blocked by CleanTalk