Sign in
|
Join
|
Help
in
Current Tags
(Entire Site)
Frederick Chapleau weBlogs
Home
Blogs
Photos
Downloads
All Tags
»
Shortcuts
(
RSS
)
Browse by Tags
Sorry, but there are no more tags available to filter with.
The params keyword, when a single argument is not enough
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.: http://msdn.microsoft.com/en-us/library/w5zay9db...
Posted to
Frederick Chapleau .NET Tip of the Day
(Weblog)
by
Frederick.Chapleau
on 07-27-2009
Usage of the @
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.
Posted to
Frederick Chapleau .NET Tip of the Day
(Weblog)
by
Frederick.Chapleau
on 07-24-2009
.ToArray()
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.
Posted to
Frederick Chapleau .NET Tip of the Day
(Weblog)
by
Frederick.Chapleau
on 07-16-2009
Array On-the-fly Creation
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.
Posted to
Frederick Chapleau .NET Tip of the Day
(Weblog)
by
Frederick.Chapleau
on 07-14-2009
Question mark, when the IIF is not there
For those who want to use the IIF, try the “ ? :” terminology, it is quite the same! -f.
Posted to
Frederick Chapleau .NET Tip of the Day
(Weblog)
by
Frederick.Chapleau
on 07-05-2009
Timespan static method
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.
Posted to
Frederick Chapleau .NET Tip of the Day
(Weblog)
by
Frederick.Chapleau
on 05-09-2009
\n\r or \r\n…
You do remember well the order of the carriage return and line feed? Check out Environment.Newline! -f.
Posted to
Frederick Chapleau .NET Tip of the Day
(Weblog)
by
Frederick.Chapleau
on 05-08-2009
Page 1 of 1 (7 items)
Copyright © Frederick Chapleau