有没有办法在C#中执行以下操作,但我正在寻找和.indexOf没有坚持到我.它是否存在,或者我应该使用其他什么方法?
string t = "joke";
string sentence = "there is no joke here";
string[] array = sentence.Split(" ".ToCharArray());
//here is the kicker
int count = array.indexOf(t);
return count;
Run Code Online (Sandbox Code Playgroud)
这应该返回3 ??
| 归档时间: |
|
| 查看次数: |
128 次 |
| 最近记录: |