Sdílet prostřednictvím


SqlFunctions.Stuff Metoda

Definice

Vloží řetězec do jiného řetězce. Odstraní zadanou délku znaků v cílovém řetězci na počáteční pozici a poté vloží druhý řetězec do cílového řetězce na počáteční pozici.

[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

Parametry

stringInput
String

Cílový řetězec.

start
Nullable<Int32>

Pozice znaku v řetězci, kam se má vložit náhradní řetězec.

length
Nullable<Int32>

Počet znaků, které se mají odstranit z stringInput . Pokud je délka delší než stringInput , dojde k odstranění až do posledního znaku v stringReplacement .

stringReplacement
String

Podřetězce, který má být vložen do stringInput .

Návraty

Řetězec, který se skládá ze dvou řetězců.

Atributy

Platí pro