Use the Convert.ToString
method and specify the base as 2. This will convert an Integer
value into a String
in the specified base
Dim result = Convert.ToString(Integer.Parse(prVal), 2)
As @Dan pointed out if you want to force this to be width 8 use the PadLeft
method
result = result.PadLeft(8, "0"c)