Created
July 30, 2014 07:57
-
-
Save Bomret/9ad4524236dc164cfed4 to your computer and use it in GitHub Desktop.
Formatting a message with multiple string args.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace param.format | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
var message = FormatMessage("{0} {0} {1} {2}", "hello", "you", "Guys"); | |
Console.WriteLine(message); | |
Console.ReadKey(); | |
} | |
static string FormatMessage(string format, params string[] args) | |
{ | |
return string.Format(format, args); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment