using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
// need to add Linq sample
using System.Linq;
namespace Linq_ex
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var word1 = from word in "hi this is vamsi testing linq".Split() orderby word.Length descending select word;
foreach (string w1 in word1)
{
MessageBox.Show(w1);
}
}
}
}
The Output will be like
testing
vamsi
linq
linq
this
is
hi
is
hi
No comments:
Post a Comment