Share via


Intern Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Retrieves the system's reference to the specified String.

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

Syntax

'Declaration
Public Shared Function Intern ( _
    str As String _
) As String
public static string Intern(
    string str
)
public:
static String^ Intern(
    String^ str
)
static member Intern : 
        str:string -> string 
public static function Intern(
    str : String
) : String

Parameters

Return Value

Type: System. . :: . .String
The system's reference to str, if it is interned; otherwise, a new reference to a string with the value of str.

Exceptions

Exception Condition
ArgumentNullException

str is null Nothing nullptr unit a null reference (Nothing in Visual Basic) .

.NET Framework Security

See Also

Reference

String Class

System Namespace