IndexOf解决办法
IndexOf
string s = "1234,51425,12354,111221,15342.....";
string v = "51425";
int d = v.IndexOf(s);
要判断v是否存在于s中;这种方式无效,d永远都是-1;要怎么解决呢??活着类似的替代方法
------解决方案--------------------
你v和s写反了
int d = s.IndexOf(v);
string s = "1234,51425,12354,111221,15342.....";
string v = "51425";
int d = v.IndexOf(s);
要判断v是否存在于s中;这种方式无效,d永远都是-1;要怎么解决呢??活着类似的替代方法
------解决方案--------------------
你v和s写反了
int d = s.IndexOf(v);