Thursday, July 21, 2011

String.Format formatting options in C#

Found a good site for this here: http://www.dijksterhuis.org/formatting-strings-stringformat/


Here's a trivial example showing the difference between Java and C#:

Java:
String.Format("Hello %s", "World");

C#:
String.Format("Hello {0:G}", "World");

No comments:

Post a Comment

There was an error in this gadget