SqlFunctions.Stuff 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將字串插入另一個字串中。 這樣會從開始位置,刪除目標字串中指定長度的字元,然後再於開始位置處,將第二個字串插入目標字串中。
[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
目標字串。
要從 stringInput 中刪除的字元數。 如果 length 超過 stringInput ,則刪除作業最多會發生到 stringReplacement 中的最後一個字元。
- stringReplacement
- String
要插入 stringInput 中的子字串。
傳回
由這兩個字串組成的字串。
- 屬性