c# 字符串切割 split

一直以来  都觉得 string.split 里面 就只能是 一个 char字符串

实际不是 那么回事 参数 能够是 string.string

eg: it

   string strtest = "asdfg12wertgv1287654"io

var test = strtest.Split(new string[]{"12"}, StringSplitOptions.RemoveEmptyEntries);test

结果为 3个 字符串变量。 后面的那个 RemoveEmptyEntries  若是 写为none 结果就  是 若是  strtest 里面 截取以后 存在空白字符  ,他就不忽略的。变量

相关文章
相关标签/搜索