Posts Tagged ‘C#’
Whenever we specify / in the DateTime format, it shows and convert the DateTime Separator that is setup in your regional settings.
so DateTime.Now.Date.ToString(@"d/MM/yyyy") will display “3-06-2010” on my pc as my regional setting has “–” as datetime separator.
If you require / in the date (or if you need any char as it is without converting it to Format specified in DateTime) then you need to add escape char before the char you require.
And that is the reason, DateTime.Now.Date.ToString(@"d\/MM\/yyyy") will give you “3/06/2010”
🙂 Happy ProgRaMMing
There are no clear method straightaway to clear the string stored in stringbuilder class.
So there are alternatives to do that.
or you can do the below also
string strObject= sbObject.ToString();
But Microsoft people woken up and put the Clear() function in .NET 4.0 🙂
I have uploaded ThreadManager class as new project on CodePlex. So it can be downloaded and used from there. It is really simple class to use with threadpool implementation. Already tested!!! :). Following is the URL
There are other projects for Threading on CodePlex website. You can search using ‘Threading’ and get the same.