Codes. Ldstr Field
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Pushes a new object reference to a string literal stored in the metadata.
public: static initonly System::Reflection::Emit::OpCode Ldstr;
public static readonly System.Reflection.Emit.OpCode Ldstr;
staticval mutable Ldstr : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldstr As OpCode
The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:
||Pushes a string object for the metadata string token
The stack transitional behavior, in sequential order, is:
- An object reference to a string is pushed onto the stack.
ldstr instruction pushes an object reference (type
O) to a new string object representing the specific string literal stored in the metadata. The
ldstr instruction allocates the requisite amount of memory and performs any format conversion required to convert the string literal from the form used in the file to the string format required at runtime.
The Common Language Infrastructure (CLI) guarantees that the result of two
ldstr instructions referring to two metadata tokens that have the same sequence of characters return precisely the same string object (a process known as "string interning").
The following Emit method overload can use the