国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

C#中字符串操作函數String.IndexOf (Char)方法

2023-05-03 13:32:44
字體:
來源:轉載
供稿:網友

報告指定 Unicode 字符在此字符串中的第一個匹配項的索引。其原型為:

public int IndexOf(char value)

參數value為要查找的 Unicode 字符。

返回值:如果找到該字符,則為 value 的從零開始的索引位置;如果未找到,則為 -1。

如:

string str = "武林網VEVB。";
        int iPos = str.IndexOf('I');

其返回值為:3

同時,IndexOf方法還有其它8種重載形式:

(1)public int IndexOf(string value)

(2)public int IndexOf(char value, int startIndex)

(3)public int IndexOf( string value, int startIndex)

(4)public int IndexOf(string value,StringComparison comparisonType )

(5)public int IndexOf(char value, int startIndex,int count )

(6)public int IndexOf(string value,int startIndex,int count )

(7)public int IndexOf(string value,int startIndex,StringComparison comparisonType )

(8)public int IndexOf(string value,int startIndex,int count, StringComparison comparisonType )

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 崇仁县| 锦州市| 工布江达县| 镇赉县| 新野县| 霍林郭勒市| 吴江市| 琼中| 阿坝| 寻乌县| 德阳市| 凉山| 施秉县| 探索| 远安县| 车致| 平乡县| 叙永县| 仪征市| 乌恰县| 巴南区| 寻乌县| 钟山县| 河间市| 惠水县| 安溪县| 从化市| 雷波县| 噶尔县| 息烽县| 于都县| 家居| 西宁市| 绥江县| 确山县| 阿拉善盟| 大关县| 哈密市| 孟州市| 镇康县| 开江县|