-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-needs-workAPI needs work before it is approved, it is NOT ready for implementationAPI needs work before it is approved, it is NOT ready for implementationarea-System.Runtime
Milestone
Description
String.Intern currently accepts a string parameter. When processing a ReadOnlySpan<char>
it would be nice to be able to intern a string without a necessary string allocation upfront. This would be especially useful for strings that would be used frequently.
For this reason I would request the following overloads added to string:
public class String
{
// Existing APIs
public static string Intern(string str);
public static string? IsInterned(string str);
// New APIs
public static string Intern(ReadOnlySpan<char> str);
public static bool IsInterned(ReadOnlySpan<char> str);
}
maragnus and rmontag-uw
Metadata
Metadata
Assignees
Labels
api-needs-workAPI needs work before it is approved, it is NOT ready for implementationAPI needs work before it is approved, it is NOT ready for implementationarea-System.Runtime