Skip to content

M_Cyjb_StringView_Slice

CYJB edited this page Mar 20, 2024 · 2 revisions

StringView.Slice 方法

返回从指定位置开始指定长度的子字符串视图。

Namespace: Cyjb
Assembly: Cyjb (in Cyjb.dll) Version: 1.0.23+7750dd8e971297c5fa962a3bee37fb78f72793f6

语法

C#

public StringView Slice(
	int startIndex,
	int length
)

参数

 

startIndex
Type: System.Int32
子字符串视图的起始位置。
length
Type: System.Int32
子字符串视图的长度。

返回值

Type: StringView
子字符串视图。

Exceptions

 

异常 条件
ArgumentOutOfRangeException startIndex 小于零或大于当前字符串视图的长度。
ArgumentOutOfRangeException startIndex + length 表示的位置不在当前字符串视图内。

Remarks

该方法是为了支持 Range 操作。

参见

Reference

StringView 结构
Cyjb 命名空间

Clone this wiki locally