Convert Enum to String
Which is the preferred way to convert an Enum to a String in .NET 3.5? Enum.GetName Enum.Format ToString Why should I prefer one … Read more
Which is the preferred way to convert an Enum to a String in .NET 3.5? Enum.GetName Enum.Format ToString Why should I prefer one … Read more
What is the recommended way of formatting TimeSpan objects into a string with a custom format? 20 Answers 20
I have some code like this: If key.Equals(“search”, StringComparison.OrdinalIgnoreCase) Then DoSomething() End If I don’t care about the case. Should I use OrdinalIgnoreCase, … Read more
I would like to compare the contents of a couple of collections in my Equals method. I have a Dictionary and an IList. … Read more
When I open my solution by double click on solution file in a file manager, Visual Studio 2012 asks me whether I want … Read more
Just looking for a short overview of GAC for a layman, not a link please. 8 Answers 8
Consider the below code: public class Class1 { public static int c; ~Class1() { c++; } } public class Class2 { public static … Read more
I have used the “select” keyword and extension method to return an IEnumerable<T> with LINQ, but I have a need to return a … Read more
I had this code: String[] lineElements; . . . try { using (StreamReader sr = new StreamReader(“TestFile.txt”)) { String line; while ((line = … Read more
Is there a difference between Server.UrlEncode and HttpUtility.UrlEncode? 6 Answers 6