Use the method Convert.ToStringand specify the base as 2. This converts the value Integerto Stringin the specified base
Dim result = Convert.ToString(Integer.Parse(prVal), 2)
As @Dan noted, if you want to make it be 8 wide, use the method PadLeft
result = result.PadLeft(8, "0"c)
source
share