The Format
methods are a set of overloads in the [System.String](<https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx>)
class used to create strings that combine objects into specific string representations. This information can be applied to [String.Format](<https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx>)
, various WriteLine
methods as well as other methods in the .NET framework.
string.Format(string format, params object[] args)
string.Format(IFormatProvider provider, string format, params object[] args)
$“string {text} blablabla”
// Since C#6format
: A composite format string, which defines the way args should be combined into a string.args
: A sequence of objects to be combined into a string. Since this uses a [params](<https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx>)
argument, you can either use a comma-separated list of arguments or an actual object array.provider
: A collection of ways of formatting objects to strings. Typical values include CultureInfo.InvariantCulture and CultureInfo.CurrentCultureNotes:
String.Format()
handles null
arguments without throwing an exception.args
parameter with one, two, or three object parameters.