StaticStringMethodCreateTState Method
Creates a new
String with a specified length and, once created,
initializes it using the specified callback.
Namespace: FolkerKinzel.StringsAssembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
public static string Create<TState>(
int length,
TState state,
SpanAction<char, TState> action
)
Public Shared Function Create(Of TState) (
length As Integer,
state As TState,
action As SpanAction(Of Char, TState)
) As String
public:
generic<typename TState>
static String^ Create(
int length,
TState state,
SpanAction<wchar_t, TState>^ action
)
static member Create :
length : int *
state : 'TState *
action : SpanAction<char, 'TState> -> string
- length Int32
- The length of the String to be created.
- state TState
- The element to be passed to action.
- action SpanActionChar, TState
- A callback to initialize the string.
- TState
- The type of the element to be passed to action.
StringThe
String created.
The method simulates the static method String.Create<TState>(int,
TState, SpanAction<char,TState>). In newer .NET versions, the call is forwarded
directly to the existing method of the
String class. In .NET Framework
and .NET Standard 2.0, the simulation makes it possible, when creating short
Strings, to have only one heap allocation.