How to add ASCII value of string into array of bytes in VB.NET

1 Answer

0 votes
Imports System
Imports System.Text

Public Module Module1
    Public Sub Main()
        Dim s As String = "vb programming"
        Dim ascii As Byte() = Encoding.ASCII.GetBytes(s)

        For Each b In ascii
            Console.Write(b & " ")
        Next
    End Sub
End Module
  
  
  
  
' run:
'
' 118 98 32 112 114 111 103 114 97 109 109 105 110 103
'

 



answered Apr 2, 2021 by avibootz

Related questions

...