从一个快照获取文本开始在 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
从基础 ITextBuffer 中的 startIndex 处开始且长度为 length 的字符串。
异常
异常 | 条件 |
---|---|
ArgumentOutOfRangeException | startIndex 大于零的小于或大于快照的长度,或者 length 小于零,或 startIndex 以及 length 大于快照的长度。 |
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。