Beispiel #1
0
 public static string ToAsciiString(this byte[] array)
 {
     lock (ToStringExtensions.lockByteToString)
     {
         if (array == null)
         {
             return(string.Empty);
         }
         string str    = new ASCIIEncoding().GetString(array, 0, array.Length);
         int    length = str.IndexOf(char.MinValue);
         if (length >= 0)
         {
             str = str.Substring(0, length);
         }
         return(str.TrimEnd(' '));
     }
 }