What is equivalent to Delphi "shl" in C #?

I am making a C # application based on Delphi (converting code), but I found a command that I don’t know (shl), and I want to know if there is any equivalent of C #.

Thanks in advance.

+2
source share
3 answers

Shl left shift . Use <<the C # operator for the same effect.

Example:

uint value = 15;              // 00001111
uint doubled = value << 1;    // Result = 00011110 = 30
uint shiftFour = value << 4;  // Result = 11110000 = 240
+7
source

From Shl Keyword, this is a bitwise left shift, which from C # Bitwise shift operators were<<

+2
source

Shl- left shift operator, in C # you use <<.

var
  a : Word;
begin
  a := $2F;   // $2F = 47 decimal
  a := a Shl $24;
end; 

matches with:

short a = 0x2F;
a = a << 0x24;
+1
source

All Articles