Skip to content

Instantly share code, notes, and snippets.

@breezhang
Created February 13, 2012 07:39
Show Gist options
  • Save breezhang/1814714 to your computer and use it in GitHub Desktop.
Save breezhang/1814714 to your computer and use it in GitHub Desktop.
C# string Fromat
int bitarray = Enumerable.Range(0, 0x100).Select(i => { var x = Convert.ToString((Byte)i, 2);
return new string('0',8-x.Length)+x;
}).Count(s => (s.IndexOf("1111") >= 0 || s.IndexOf("000") >= 0));
@breezhang
Copy link
Author

binary format how
linq query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment