System Namespace String Class
Retrieves a reference to a specified String.
[ VB ]
<Serializable>
Public Shared Function IsInterned ( _
ByVal str As String _
) As String
[ C# ]
[ Serializable ]
public static string IsInterned (
string str
);
[ C++ ]
[ Serializable ]
public: static String* IsInterned (
String* str
);
[ JScript ]
public Serializable
static function IsInterned (
str : String
) : String;
- str
- A String.
A String reference to str if it is in the common language runtime "intern pool"; otherwise a null reference ( Nothing in Visual Basic ).
The common language runtime automatically maintains a table, called the "intern pool", which contains a single instance of each unique literal string constant declared in a program, as well as any unique instance of String you add programmatically.
The intern pool conserves string storage. If you assign a literal string constant to several variables, each variable is set to reference the same constant in the intern pool instead of referencing several different instances of String that have identical values.
This method looks up str in the intern pool. If str has already been interned, a reference to that instance is returned; otherwise, a null reference ( Nothing in Visual Basic ) is returned.
Compare this method to the Intern method.
This method does not return a Boolean value, but can still be used where a Boolean is needed.
String Members Intern