Byte value binary And operation : Byte « Data Types « VB.Net






Byte value binary And operation

 

Imports System.Globalization

Module Example
   Public Sub Main()
      Dim values() As String = { Convert.ToString(12, 16), _
                                 Convert.ToString(123, 16), _
                                 Convert.ToString(245, 16) }

      Dim mask As Byte = &hFE
      For Each value As String In values
         Dim byteValue As Byte = Byte.Parse(value, NumberStyles.AllowHexSpecifier)
         Console.WriteLine("{0} And {1} = {2}", byteValue, mask, byteValue And mask)
      Next         
   End Sub
End Module

   
  








Related examples in the same category

1.Insert xByte to StringBuilder
2.Generic and nongeneric versions of the CompareTo method for Byte value
3.Use the Sign(Byte) method to determine the sign of a byte value and display it to the console.
4.Byte Structure Represents an 8-bit unsigned integer.
5.Convert Integer to Byte
6.Convert Double to Byte
7.Use Convert class to convert Integer to Byte
8.Parse string to Byte
9.Parse Hex Number String to Byte
10.Convert Byte to String with default format
11.Display Byte value with 3 digits and leading zeros
12.Display byte value with hexadecimal
13.Display byte value with four hexadecimal digits
14.Display Byte Value as Binary, Octal and Hex Numbers
15.Parse Hex string to Byte
16.Bit and operation for Byte
17.Convert Hex byte value to Hex string
18.Byte.Equals Method returns a value indicating whether this instance and a specified Byte object represent the same value.
19.Byte.MaxValue
20.Byte.ToString Method converts Byte to string using culture-specific formatting information.
21.Byte.ToString (String) converts Byte to string using the specified format.
22.Byte.ToString converts Byte to string using the specified format and culture-specific formatting information.
23.Byte.ToString converts Byte to string representation.
24.Byte.TryParse tries to convert string to Byte and returns a value that indicates whether the conversion succeeded.
25.Byte.TryParse converts string in a style and culture-specific format to Byte
26.Convert Double to Byte with CByte
27.Parse string to Byte
28.Parse string to Byte as System.Globalization.NumberStyles.HexNumber
29.Byte format: D3, X2 and X4
30.Format Byte to Binary, Octal and Hex string