Contents tagged with Visual Studio 2005
-
How do i return integers from a string ?
Suppose you are passing a string(for e.g.: “My name has 1 K, 2 A and 3 N”) which may contain integers, letters or special characters. I want to retrieve only numbers from the input string. We can implement it in many ways such as splitting the string into an array or by using TryParse method. I would like to share another idea, that’s by using Regular expressions. All you have to do is, create an instance of Regular Expression with a specified pattern for integer. Regular expression class defines a method called Split, which splits the specified input string based on the pattern provided during object initialization.
-
Exporting Dataset as CSV
Hi Everyone,
-
Simple way to check your code performance
Hi guys,Of course, we all know foreach loop takes more time than for loop and there are lot of similar scenarios in .Net. Even if it takes lot of time, we'll be forced to use foreach loop at some cases. So it'll be better, if we come to know the time taken for executing a piece of code at the runtime. Here is a simple way to find out the time taken for each process.It just writes the start time and finish time taken for the process in the debug window. Debug.Indent() method simply changes the indentation of the Output by one level and Debug.WriteLine() method writes a string in the debug window.