| length() | 取得字串長度 |
| Remove(int1,int2) | 從int1(起始位置)開始刪除長度為int2的字串 |
| Insert(int,string) | 在int的位置插入string |
| Substring(int) | 從參數開始取出剩下的字串 |
| Substring(int1,int2) | 取出int1開始長度為int2的字串 |
| IndexOf(string) | 傳回第一次搜尋到字串(string)的位置 |
| IndexOf(string,int) | 傳回第一次搜尋到字串(string)的位置,開始搜尋位置為int |
| LastIndexOf(string) | 跟IndexOf功能類似,但從後面開始搜尋 |
| LastIndexOf(string,int) | 跟IndexOf功能類似,但從後面開始搜尋 |
| Replace(char,char) | 取代字元 |
| ToLower() | 將英文轉成小寫 |
| ToUpper() | 將英文轉成大寫 |
| Trim() | 刪除字串前後的空白字元 |
| TrimEnd() | 刪除字串尾部的空白字元 |
| TrimStart() | 刪除字串開頭的空白字元 |
呼叫範例:
str = str.Remove(2,2);C#的字串起始位置是0,VB慣用者要注意一下。
integer = IndexOf("test");
str = str.ToLower();
string test = "www";
int itest = test.IndexOf("w");
這時候itest的值是0。

沒有留言:
張貼留言