Created
May 27, 2016 06:21
-
-
Save Phuseos/373efa194dafb5297de14c9969f9e1d2 to your computer and use it in GitHub Desktop.
Simple LinQ sample - string aggregation (C#)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void btnLINQ_Click(object sender, EventArgs e) | |
{ | |
string[] WordsToUse = { "Hello ", "World", "!" }; //Array of words to use | |
var Res = WordsToUse.Aggregate((current, next) => current + next); //Aggregate words using LINQ | |
System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "alert('" + Res + "');", true); //Print text using JavaScript (don't use in production) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment