共用方式為


RegexCollection.Insert 方法 (Int32, Regex)

將項目插入 RegexCollection 中指定的索引處。

命名空間:  Microsoft.Office.Tools
組件:  Microsoft.Office.Tools.Common (在 Microsoft.Office.Tools.Common.dll 中)

語法

'宣告
Sub Insert ( _
    index As Integer, _
    value As Regex _
)
void Insert(
    int index,
    Regex value
)

參數

  • index
    型別:System.Int32
    應該插入 value 之以零起始的索引。

例外狀況

例外狀況 條件
ArgumentOutOfRangeException

index 小於零。

-或-

index 大於 Count

NotSupportedException

RegexCollection 是唯讀的。

-或-

RegexCollection 具有固定的大小。

備註

如果 Count 已經等於容量,會在插入新項目前先自動重新配置內部陣列,使清單容量加倍。

如果 index 等於 Count,則將 value 加入 RegexCollection 的結尾。

.NET Framework 安全性

請參閱

參考

RegexCollection 介面

Insert 多載

Microsoft.Office.Tools 命名空間