ITextSnapshot.GetText 方法 (Int32, Int32)
取得文字,從快照集開始,於startIndex而長度等於length。
命名空間: Microsoft.VisualStudio.Text
組件: Microsoft.VisualStudio.Text.Data (在 Microsoft.VisualStudio.Text.Data.dll 中)
語法
'宣告
Function GetText ( _
startIndex As Integer, _
length As Integer _
) As String
string GetText(
int startIndex,
int length
)
String^ GetText(
int startIndex,
int length
)
abstract GetText :
startIndex:int *
length:int -> string
function GetText(
startIndex : int,
length : int
) : String
參數
startIndex
類型:Int32起始索引。
length
類型:Int32要取得之文字的長度。
傳回值
類型:String
長度為 length 的字串,這個字串起始於基礎 ITextBuffer 中的 startIndex。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentOutOfRangeException | startIndex小於零或大於長度的快照集,或length小於零,或startIndex加上length大於快照集的長度。 |
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。