Convert IEnumerable To Hex String - CSharp System.Collections

CSharp examples for System.Collections:IEnumerable

Description

Convert IEnumerable To Hex String

Demo Code


using System.Linq;
using System.Collections.Generic;
using System;/*  ww  w.j  a va2s.c om*/

public class Main{
        public static string ToHexString(this IEnumerable<byte> bytes)
        {
            return string.Concat(bytes.Select(b => b.ToString("x2")).ToArray());
        }
}

Related Tutorials