Get The Most Out Of Your Format String

Posted by: youve been HAACKED, on 15 Feb 2006 | View original | Bookmarked: 0 time(s)

I was reviewing some code when I ran into code that fit this pattern all over the place (simplified to make a point). string format = "/comments/{0}/{1}.aspx#";string url = String.Format(CultureInfo.InvariantCulture, format + entity.Id, entity.ParentID, entity.Date.ToString("yyyy/MM/dd", CultureInfo.InvariantCulture)); There are a couple things I want you to notice here. The first is concatenation of the entity id to the end of the format string. format + entity.Id Second, notice format string...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: XML | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1556 | Hits: 48

Similar Posts

  • A RouteHandler for IHttpHandlers more
  • MVC or Web Forms? A Dying Question more
  • Using T4 Templates for Simple DTOs more
  • Postgresql - Day 2 more
  • No JavaScript IntelliSense in VS 2010 Beta 2? Reset your Settings more
  • Dynamic in C# 4.0: Creating Wrappers with DynamicObject more
  • My History of Visual Studio (Part 2) more
  • Private Extension Methods more
  • Telerik Releases New Controls for Silverlight 3 and WPF more
  • Filtering with string parameter that allows free user input more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD