码迷,mamicode.com
首页 > Windows程序 > 详细

C#查找字符串位置

时间:2018-12-01 13:13:38      阅读:342      评论:0      收藏:0      [点我收藏+]

标签:http   tar   ring   src   amp   string   str   ref   inter   

int i=zifuchuan.IndexOf(",");
int n=(zifuchuan.SubString(i+1)).IndexOf(",");
int index=i+n;
index就是你求的第二个“,”的位置

如果求的是第三个第四个“,”的位置,就要用递归函数来写,具体思路跟上面的代码差不多

C#查找字符串位置

标签:http   tar   ring   src   amp   string   str   ref   inter   

原文地址:https://www.cnblogs.com/bwdblogs/p/10048701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!