Essentially, I have a string that has placeholders that I am passing into String::Format(), as such:
"The {0} brown {1} jumped over the {2} {3}."
And I have another comma delimited string which contains the strings I wish to fill in to the formatting placeholders, as such:
"quick,fox,lazy,dog"
So it would only seem natural that to fill the format string I would Split(',') the second string, and pass that as the second argument in Format(first_str, second_split_array);
But splitting the second array produces a System::Array^ which Format() sees as only one object, thus getting angry and telling me my index must be less than or equal to the number of arguments passed.
Last I heard, String.Format() can use an array as the second arg, so... what do I have to do to get the string split in a way that Format() will see as all the args?
Edit:
The idea here is that the number of indexed elements is not the same every time. The goal I am trying to achieve is to take data sent from a server and fill it in to a template. The server sends back a comma delimited list and a template name. So, for the quick fox example it'd send what I have above, but other times It'll send, say, error, which uses:
"An error has occurred: {0}
(Details: {1})"
and the server arguments "Error Name,Error text description and such."