StringPool.GetOrAdd Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
GetOrAdd(ReadOnlySpan<Char>) |
Gets a cached String instance matching the input content, or creates a new one. |
GetOrAdd(String) |
Gets a cached String instance matching the input content, or stores the input one. |
GetOrAdd(ReadOnlySpan<Byte>, Encoding) |
Gets a cached String instance matching the input content (converted to Unicode), or creates a new one. |
GetOrAdd(ReadOnlySpan<Char>)
Gets a cached String instance matching the input content, or creates a new one.
public string GetOrAdd (ReadOnlySpan<char> span);
member this.GetOrAdd : ReadOnlySpan<char> -> string
Public Function GetOrAdd (span As ReadOnlySpan(Of Char)) As String
Parameters
- span
- ReadOnlySpan<Char>
The input ReadOnlySpan<T> with the contents to use.
Returns
A String instance with the contents of span
, cached if possible.
Applies to
GetOrAdd(String)
Gets a cached String instance matching the input content, or stores the input one.
public string GetOrAdd (string value);
member this.GetOrAdd : string -> string
Public Function GetOrAdd (value As String) As String
Parameters
Returns
A String instance with the contents of value
, cached if possible.
Applies to
GetOrAdd(ReadOnlySpan<Byte>, Encoding)
Gets a cached String instance matching the input content (converted to Unicode), or creates a new one.
public string GetOrAdd (ReadOnlySpan<byte> span, System.Text.Encoding encoding);
member this.GetOrAdd : ReadOnlySpan<byte> * System.Text.Encoding -> string
Public Function GetOrAdd (span As ReadOnlySpan(Of Byte), encoding As Encoding) As String
Parameters
- span
- ReadOnlySpan<Byte>
The input ReadOnlySpan<T> with the contents to use, in a specified encoding.
Returns
A String instance with the contents of span
, cached if possible.