Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Create(IFormatProvider, Span<Char>, DefaultInterpolatedStringHandler) |
Creates a new string by using the specified provider to control the formatting of the specified interpolated string. |
Create(IFormatProvider, DefaultInterpolatedStringHandler) |
Creates a new string by using the specified provider to control the formatting of the specified interpolated string. |
Create<TState>(Int32, TState, SpanAction<Char,TState>) |
Creates a new string with a specific length and initializes it after creation by using the specified callback. |
Creates a new string by using the specified provider to control the formatting of the specified interpolated string.
public:
static System::String ^ Create(IFormatProvider ^ provider, Span<char> initialBuffer, System::Runtime::CompilerServices::DefaultInterpolatedStringHandler % handler);
public static string Create(IFormatProvider? provider, Span<char> initialBuffer, ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler handler);
static member Create : IFormatProvider * Span<char> * DefaultInterpolatedStringHandler -> string
Public Shared Function Create (provider As IFormatProvider, initialBuffer As Span(Of Char), ByRef handler As DefaultInterpolatedStringHandler) As String
An object that supplies culture-specific formatting information.
The initial buffer that may be used as temporary space as part of the formatting operation. The contents of this buffer may be overwritten.
The interpolated string, passed by reference.
The string that results for formatting the interpolated string using the specified format provider.
Product | Versions |
---|---|
.NET | 6, 7, 8, 9, 10 |
Creates a new string by using the specified provider to control the formatting of the specified interpolated string.
public:
static System::String ^ Create(IFormatProvider ^ provider, System::Runtime::CompilerServices::DefaultInterpolatedStringHandler % handler);
public static string Create(IFormatProvider? provider, ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler handler);
static member Create : IFormatProvider * DefaultInterpolatedStringHandler -> string
Public Shared Function Create (provider As IFormatProvider, ByRef handler As DefaultInterpolatedStringHandler) As String
An object that supplies culture-specific formatting information.
The interpolated string, passed by reference.
The string that results for formatting the interpolated string using the specified format provider.
Product | Versions |
---|---|
.NET | 6, 7, 8, 9, 10 |
Creates a new string with a specific length and initializes it after creation by using the specified callback.
public:
generic <typename TState>
static System::String ^ Create(int length, TState state, System::Buffers::SpanAction<char, TState> ^ action);
public static string Create<TState>(int length, TState state, System.Buffers.SpanAction<char,TState> action) where TState : allows ref struct;
public static string Create<TState>(int length, TState state, System.Buffers.SpanAction<char,TState> action);
static member Create : int * 'State * System.Buffers.SpanAction<char, 'State> -> string
Public Shared Function Create(Of TState) (length As Integer, state As TState, action As SpanAction(Of Char, TState)) As String
The type of the element to pass to action
.
The length of the string to create.
The element to pass to action
.
A callback to initialize the string.
The created string.
The initial content of the destination span passed to action
is undefined. Therefore, it is the delegate's responsibility to ensure that every element of the span is assigned. Otherwise, the resulting string could contain random characters.
To support interop scenarios, the underlying buffer is guaranteed to be at least 1 greater than represented by the span parameter of the action callback. This additional index represents the null-terminator and, if written, that is the only value supported. Writing any value other than the null-terminator corrupts the string and is considered undefined behavior.
Product | Versions |
---|---|
.NET | Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in