Print byte array - CSharp System

CSharp examples for System:Byte Array

Description

Print byte array

Demo Code


using System.Text;
using System.Collections;
using System;/*w w w  .j  a v a 2 s.  c o m*/

public class Main{
        // specifically for byte arrays
        public static string Print(this byte[] values)
        {
            var sb = new StringBuilder();
            
            for (int i = 0; i < values.Length-1; i++)
            {
                sb.Append(values[i].ToString() + " ");
            }
            sb.Append(values[values.Length-1].ToString());
            return sb.ToString();
        }
}

Related Tutorials