Retrieves the reference for the string.
[Visual Basic] Public Shared Function IsInterned( _ ByVal str As String _ ) As String [C#] public static string IsInterned( string str ); [C++] public: static String* IsInterned( String* str ); [JScript] public static function IsInterned( str : String ) : String;
The reference to the string.
Exception Type | Condition |
---|---|
ArgumentNullException | Iif the string is null. |
The Intern method looks up the string in a table of string identities of AppDomain. It is used primarily for constants and returns a reference to the "official" copy of the string. This takes a string as an argument. If that string has already been interned, it returns a reference to the interned object; otherwise it returns null.
Note that if the string is null, it will cause an exception to be thrown.
The other relevant method is Intern.