Exemple #1
0
 /// <summary>
 /// Returns the binary string representation of specified unsigned integer value.
 /// </summary>
 /// <param name="Value">Source uint value.</param>
 /// <param name="Length">Length of the bit array.</param>
 /// <param name="BitDelimiter">Sets whether some kind of bit delimiter should be used.</param>
 /// <returns>Returns the binary string representation of specified unsigned integer value with specified length.</returns>
 public static string ToString(uint Value, int Length, ZBitDelimiter BitDelimiter)
 {
     string S = "";
     if (Length > 32)	Length = 32;
     for (int i = 0; i < Length; i++)
     {
         if (GetBit(Value, i))	S = "1" + S;	else S = "0" +S;
         if (BitDelimiter != ZBitDelimiter.None)
             if ((i+1) % (int)BitDelimiter == 0)	 S = BitDelimiterChar + S;
     }
     return S.Trim(BitDelimiterChar);
 }
Exemple #2
0
 /// <summary>
 /// Returns the string representation of this ZBitArray instance.
 /// </summary>
 /// <param name="Length">Length of the bit array.</param>
 /// <param name="BitDelimiter">Sets whether some kind of bit delimiter should be used.</param>
 /// <returns>Returns the string representation of this ZBitArray instance.</returns>
 public string ToString(int Length, ZBitDelimiter BitDelimiter)
 {
     ZBits.BitDelimiterChar = ZBitArray.BitDelimiterChar;
     return ZBits.ToString(this.ToUInt(), Length, BitDelimiter);
 }
Exemple #3
0
 /// <summary>
 /// Returns the binary string representation of specified unsigned integer value.
 /// </summary>
 /// <param name="Value">Source uint value.</param>
 /// <param name="BitDelimiter">Sets whether some kind of bit delimiter should be used.</param>
 /// <returns>Returns the binary string representation of specified unsigned integer value.</returns>
 public static string ToString(uint Value, ZBitDelimiter BitDelimiter)
 {
     return ToString(Value, 32, BitDelimiter);
 }
Exemple #4
0
 /// <summary>
 /// Returns the string representation of this ZBitArray instance.
 /// </summary>
 /// <param name="BitDelimiter">Sets whether some kind of bit delimiter should be used.</param>
 /// <returns>Returns the string representation of this ZBitArray instance.</returns>
 public string ToString(ZBitDelimiter BitDelimiter)
 {
     return ToString(32, BitDelimiter);
 }