lamp

Browse by Tags

Sorry, but there are no more tags available to filter with.
The params keyword, when a single argument is not enough
27 July 09 11:53 PM | Frederick.Chapleau | with no comments
When you don’t want to provide a fixed number of argument for a method, you can use the params modifier, that can handle a list of values of a single type, instead of requiring from the caller to build a list. void UseParams(params int[] list) -f. ref...
Filed under:
Usage of the @
24 July 09 05:05 PM | Frederick.Chapleau | with no comments
In C#, when you have a string with slash in it, you must double it to have a result of only one, because of the escape code. When starting a string with a @, you can’t insert escape code, but you do not have to double them. -f.
Filed under:
.ToArray()
16 July 09 07:11 PM | Frederick.Chapleau | with no comments
In opposition of a previous post, if you need to create a Array with unknow length, you can just create an ArrayList and call the ToArray() method on it. -f.
Filed under:
Array On-the-fly Creation
14 July 09 12:51 PM | Frederick.Chapleau | with no comments
If you do not know it, you can create on-th-fly an array, without passing thru an Arraylist or other lists that as the .ToArray() method. new object[] { item, item, item} // give you an array with 3 items. -f.
Filed under:
Question mark, when the IIF is not there
05 July 09 09:05 AM | Frederick.Chapleau | with no comments
For those who want to use the IIF, try the “ ? :” terminology, it is quite the same! -f.
Filed under:
Timespan static method
09 May 09 07:25 AM | Frederick.Chapleau | with no comments
If you are trying to create a Timespan for 30 second by creating a new Timespan(0, 0, 30); you are using the long way… Look a the static methods, like Timespan.FromSecond(30)… -f.
Filed under:
\n\r or \r\n…
08 May 09 07:52 PM | Frederick.Chapleau | with no comments
You do remember well the order of the carriage return and line feed? Check out Environment.Newline! -f.
Filed under: