如何在VB.NET中按位左右按位移位?它甚至有operators,还是我必须使用一些实用方法?
答案 0 :(得分:16)
答案 1 :(得分:7)
myFinal = myInteger << 4 ' Shift LEFT by 4 bits.
myFinal = myInteger >> 4 ' Shift RIGHT by 4 bits.
您也可以将它作为一元操作员使用......
myFinal <<= 4 ' Shift myFinal LEFT by 4 bits, storing the result in myFinal.
myFinal >>= 4 ' Shift myFinal RIGHT by 4 bits, storing the result in myFinal.