SqlFunctions.Stuff 方法

定义

将一个字符串插入另一个字符串。 这会从目标字符串中的起始位置开始,删除指定长度的字符,然后在目标字符串中的起始位置处,插入第二个字符串。

public:
 static System::String ^ Stuff(System::String ^ stringInput, Nullable<int> start, Nullable<int> length, System::String ^ stringReplacement);
[System.Data.Objects.DataClasses.EdmFunction("SqlServer", "STUFF")]
public static string Stuff (string stringInput, int? start, int? length, string stringReplacement);
[<System.Data.Objects.DataClasses.EdmFunction("SqlServer", "STUFF")>]
static member Stuff : string * Nullable<int> * Nullable<int> * string -> string
Public Shared Function Stuff (stringInput As String, start As Nullable(Of Integer), length As Nullable(Of Integer), stringReplacement As String) As String

参数

stringInput
String

目标字符串。

start
Nullable<Int32>

stringInput 中要插入替换字符串的字符位置。

length
Nullable<Int32>

要从 stringInput 中删除的字符数。 如果 lengthstringInput 长,则最多删除到 stringReplacement 中的最后一个字符。

stringReplacement
String

要插入 stringInput 中的子字符串。

返回

由这两个字符串组成的字符串。

属性

注解

不能直接调用此函数。 此函数只能出现在 LINQ to Entities 查询中。

此函数将转换为数据库中的相应函数。 有关相应 SQL Server 函数的信息,请参阅 STUFF (Transact-SQL)

适用于