Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Silly excersise
Message
 
 
À
17/02/2011 07:52:00
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01500484
Message ID:
01500513
Vues:
35
>>Just to exercise my new found 'Effective C#' knowledge :-} :
static IEnumerable<char> GetChars(string s)
>>   {
>>        return Enumerable.Range(0, s.Length / 8).Select(i =>
>>        Convert.ToChar(Convert.ToInt32(s.Substring(i * 8, 8),2)));
>>    }
then
string result = string.Empty;
>>foreach (char c in GetChars(s1))
>>{
>>     result += c;
>> }
>> Nothing like making it complicated when simple would do :-}
>
>
>haha - Well, at least you like the book - and it explores a few things
>
>
>I have the impression it can still be done in a shorter way - with lambda expressions - but I have not touched C# in 7 months

What have you been touching?
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform