Metodo SqlFunctions.Stuff
[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]
Inserisce una stringa in un'altra stringa. Elimina una lunghezza specificata di caratteri nella stringa di destinazione nella posizione iniziale, quindi inserisce la seconda stringa nella stringa di destinazione nella posizione iniziale.
Spazio dei nomi: System.Data.Entity.SqlServer
Assembly: EntityFramework.SqlServer (in EntityFramework.SqlServer.dll)
Sintassi
'Dichiarazione
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "length")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "stringReplacement")> _
<DbFunctionAttribute("SqlServer", "STUFF")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "start")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "stringInput")> _
<SuppressMessageAttribute("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId := "string")> _
Public Shared Function Stuff ( _
stringInput As String, _
start As Nullable(Of Integer), _
length As Nullable(Of Integer), _
stringReplacement As String _
) As String
'Utilizzo
Dim stringInput As String
Dim start As Nullable(Of Integer)
Dim length As Nullable(Of Integer)
Dim stringReplacement As String
Dim returnValue As String
returnValue = SqlFunctions.Stuff(stringInput, _
start, length, stringReplacement)
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "length")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "stringReplacement")]
[DbFunctionAttribute("SqlServer", "STUFF")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "start")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "stringInput")]
[SuppressMessageAttribute("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string")]
public static string Stuff(
string stringInput,
Nullable<int> start,
Nullable<int> length,
string stringReplacement
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"length")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"stringReplacement")]
[DbFunctionAttribute(L"SqlServer", L"STUFF")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"start")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"stringInput")]
[SuppressMessageAttribute(L"Microsoft.Naming", L"CA1720:IdentifiersShouldNotContainTypeNames", MessageId = L"string")]
public:
static String^ Stuff(
String^ stringInput,
Nullable<int> start,
Nullable<int> length,
String^ stringReplacement
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "length")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "stringReplacement")>]
[<DbFunctionAttribute("SqlServer", "STUFF")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "start")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "stringInput")>]
[<SuppressMessageAttribute("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string")>]
static member Stuff :
stringInput:string *
start:Nullable<int> *
length:Nullable<int> *
stringReplacement:string -> string
public static function Stuff(
stringInput : String,
start : Nullable<int>,
length : Nullable<int>,
stringReplacement : String
) : String
Parametri
- stringInput
Tipo: System.String
Stringa di destinazione.
- start
Tipo: System.Nullable<Int32>
Posizione del carattere in stringInput dove è necessario inserire la stringa di sostituzione.
- length
Tipo: System.Nullable<Int32>
Numero di caratteri da eliminare da stringInput. Se la lunghezza è maggiore di quella di stringInput, l'eliminazione viene eseguita fino all'ultimo carattere in stringReplacement.
- stringReplacement
Tipo: System.String
Sottostringa da inserire in stringInput.
Valore restituito
Tipo: System.String
Stringa costituita dalle due stringhe.