string foo = "The {0} red {1} jumps {2} the {{0}} {{1}} dog.";
string bar = String.Format(foo, "quick", "fox", "over");
string baz = String.Format(bar, "lazy", "brown");
The variables instantiated above will end up with the following values:
foo | The {0} red {1} jumps {2} the {{0}} {{1}} dog. |
bar | The quick red fox jumps over the {0} {1} dog. |
baz | The quick red fox jumps over the lazy brown dog. |
No comments:
Post a Comment