Showing posts from January, 2016

101 LINQ Samples

Am I the last person to know about this?! Over a hundred code samples showing essential LINQ operations. Samples are broken into the following categories: Restriction Operators Projection Operators Partitioning Operators Ordering Operators Grouping Operators Set Operators Conversion Operators Element Operators Generation Operators Quantifiers Aggregate Operators Miscellaneous Operators Custom Sequence Operators Query Execution Operators Join Operators Nice!

Quick and Easy Way to Convert Unicode to ASCII (C#)

///   <summary> ///  Given a string, replaces UNICODE characters with ASCII characters ///   </summary> ///   <param name="s"> the string to be scrubbed of UNICODE characters </param> ///   <returns> a string with only ASCII characters </returns> ///   <code> ///  string myString = "BÌĹĹ GÓÓĎ"; ///  System.Console.WriteLine(" Converted string = " + Utilties. ConvertUnicodeToAsciiV2( myString)); ///   </code> public   static   string  ConvertUnicodeToAsciiV2( string  s) {      return   Encoding .ASCII.GetString( Encod ing .GetEncoding(437).GetBytes( s)); }