/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/Byte/Overview/vb/bitwise1.vb
25 строк
759 B
Genevieve Warren
Move member remarks (#39270)
30 янв 2024, 00:43
Не верифицирован
30 янв 2024, 00:43
6c88824
Код
Авторство
О чём код?
' Visual Basic .NET Document Option Strict On ' <Snippet1> Imports System.Globalization Module Example1 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 ' The example displays the following output: ' 12 And 254 = 12 ' 123 And 254 = 122 ' 245 And 254 = 244 ' </Snippet1>