Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
IFormatProvider Caveat
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class FormatProv : IFormatProvider, ICustomFormatter { public object GetFormat(Type formatType) { if (formatType == typeof(FormatProv)) return this; return null; } public string Format(string format, object arg, IFormatProvider formatProvider) { return format; } } public class Program { public static void Main(string[] args) { Console.WriteLine( string.Format(new FormatProv(), "format just loves {0:me}", "you")); Console.WriteLine( string.Format(new FormatProv(), "format just loves {0:me}", 1)); } } }
run
|
edit
|
history
|
help
0
Volatile madness
F ?
Test equality
using int.TryParse
stack with stack Data type
test
Hello
shuffle2
Ternary Operator
Date Diff