LINQ Select Statement Using Anonymous Types in C#

by a Guest on October 15, 2010 0 Comments

public void UpperCaseLowerCase()
{
    string[] words = { "aPPLE", "BlUeBeRrY", "cHeRry" };

    var upperLowerWords =
        from w in words
        select new {Upper = w.ToUpper(), Lower = w.ToLower()};

    foreach (var ul in upperLowerWords) {
        Console.WriteLine("Uppercase: {0}, Lowercase: {1}", ul.Upper, ul.Lower);
    }
}

// Result

Uppercase: APPLE, Lowercase: apple
Uppercase: BLUEBERRY, Lowercase: blueberry
Uppercase: CHERRY, Lowercase: cherry

LINQ Select Statement in C#

by a Guest on October 15, 2010 0 Comments

Example of a LINQ Select statement where the method adds 1 to the number and prints them out:

public void AddOneToValue()
{
    int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };

    var numsPlusOne =
        from n in numbers
        select n + 1;
   
    Console.WriteLine("Numbers + 1:");

    foreach (var i in numsPlusOne)
    {
        Console.WriteLine(i);
    }
}

// Result

Numbers + 1:
6
5
2
4
10
9
7
8
3
1

Nivo Slider is One Awesome jQuery Image Slider

by a Guest on October 3, 2010 0 Comments

Nivo Slider is the most awesome jQuery image slider, manual and auto slide transaction with cool effect. jqFancyTransitions is easy-to-use jQuery plugin for displaying your photos as slideshow with fancy transition effects.

Nivo Slider Home Page

Do You Prefer C# to Visual Basic?

by a Guest on August 13, 2010 0 Comments

Please give us your thoughts on using C# instead of Visual Basic or vice versa.

Page 1 of 1.

Post categories

Post archives