Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Silly excersise
Message
 
 
To
17/02/2011 07:52:00
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01500484
Message ID:
01500513
Views:
36
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform