语言

SqlFunctions.Stuff 方法

定义

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

[System.Data.Entity.DbFunction("SqlServer", "STUFF")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="start")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="stringInput")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="stringReplacement")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId="string")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="length")]
public static string Stuff(string stringInput, Nullable<int> start, Nullable<int> length, string stringReplacement);
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 中删除的字符数。 如果长度超过 stringInput,则删除操作最多发生在 stringReplacement 中的最后一个字符。

stringReplacement
String

要插入到 stringInput 中的子字符串。

返回

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

特性

适用于