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.

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);
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

类型参数

TState

要传递给 action的元素的类型。The type of the element to pass to action.

参数

length
Int32

要创建的字符串的长度。The length of the string to create.

state
TState

要传递给 action 的元素。The element to pass to action.

action
SpanAction<Char,TState>

用于初始化字符串的回叫。A callback to initialize the string.

返回

创建的字符串。The created string.

适用于