Share via


ModuleBuilder.GetStringConstant Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns the token of the given string in the module’s constant pool.

Namespace:  System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Function GetStringConstant ( _
    str As String _
) As StringToken
[SecuritySafeCriticalAttribute]
public StringToken GetStringConstant(
    string str
)

Parameters

  • str
    Type: System.String
    The string to add to the module's constant pool.

Return Value

Type: System.Reflection.Emit.StringToken
The token of the string in the constant pool.

Exceptions

Exception Condition
ArgumentNullException

str is nulla null reference (Nothing in Visual Basic).

Remarks

If str has already been defined, the existing token will be returned.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.