Javatpoint Logo
Javatpoint Logo

C# String IsInterned()

The C# IsInterned() method is used to get reference of the specified string.

The difference between Intern() and IsInterned() is that Intern() method interns the string if it is not interned but IsInterned() doesn't do so. In such case, IsInterned() method returns null.

Signature

Parameter

str: it is a string type parameter.

Return

It returns a reference.


C# String IsInterned() Method Example

Output:

Hello C#
Hello C#
Hello C#

C# String Intern() vs IsInterned() Example

Output:

True
False




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA