Skip to content

Instantly share code, notes, and snippets.

@Bomret
Created July 30, 2014 07:57
Show Gist options
  • Save Bomret/9ad4524236dc164cfed4 to your computer and use it in GitHub Desktop.
Save Bomret/9ad4524236dc164cfed4 to your computer and use it in GitHub Desktop.
Formatting a message with multiple string args.
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