title: Convert List<boolean> to String
body: <p>I got a boolean list with 92 booleans, I want the list to be converted to a string, I thought I ll take 8 booleans(bits) and put them in a Byte(8 bits) and then use the ASCII to convert it the byte value to a char then add the chars to a string. However after googeling for more then 2 hours, no luck atm. I tried converting the List to a Byte list but it didn t work either ^^.</p>
  
  <pre><code>String strbyte = null;
  for (int x = 0; x != tmpboolist.Count; x++) //tmpboolist is the 90+- boolean list
  {
     //this loop checks for true then puts a 1 or a 0 in the string(strbyte)
     if (tmpboolist[x])
     {
        strbyte = strbyte + '1'; 
     }
     else
     {
        strbyte = strbyte + '0';
     }
  }
  
  //here I try to convert the string to a byte list but no success
  //no success because the testbytearray has the SAME size as the 
  //tmpboolist(but it should have less since 8 booleans should be 1 Byte)
  //however all the 'Bytes' are 48 &amp; 49 (which is 1 and 0 according to
  //http://www.asciitable.com/)
  Byte[] testbytearray = Encoding.Default.GetBytes(strbyte); 
  </code></pre>
  
  <p>PS If anyone has a better suggestion on how to code &amp; decode a Boolean list to a String?
  (Because I want people to share their boolean list with a string rather then a list of 90 1 and 0s.)</p>
  
  <p>EDIT: got it working now! ty all for helping </p>
  
  <pre><code>string text = new string(tmpboolist.Select(x =&gt; x ? '1' : '0').ToArray());
  byte[] bytes = getBitwiseByteArray(text); //http://stackoverflow.com/a/6756231/1184013
  String Arraycode = Convert.ToBase64String(bytes);
  System.Windows.MessageBox.Show(Arraycode);
  //first it makes a string out of the boolean list then it uses the converter to make it an Byte[](array), then we use the base64 encoding to make the byte[] a String.(that can be decoded later)
  </code></pre>
  
  <p>I ll look into the encoding32 later, ty for all the help again :)</p>