0 Comments

/// <summary>
        /// Convert a byte array to a hex string
        /// </summary>
        /// <param name="bytes"></param>
        /// <returns>
        ///     Converted byte array to string
        ///     null, when bytes == null
        /// </returns>
        public string ConvertByteArrayToString(byte[] bytes)
        {
            string result = null;

            // Convert byte array to string, when bytes is not null
            if (bytes != null)
            {
                result = BitConverter.ToString(bytes);
                result = result.Replace("-", string.Empty);
            }

            return result;
        }

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts