Javatpoint Logo
Javatpoint Logo

C# String Intern(String str)

The C# Intern() method is used to retrieve reference to the specified String. It goes to intern pool (memory area) to search for a string equal to the specified String. If such a string exists, its reference in the intern pool is returned. If the string does not exist, a reference to specified String is added to the intern pool, then that reference is returned.


The signature of intern method is given below:


str: it is a parameter of type string.

C# String Intern() Method Example


Hello C#
Hello C#

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA