zoukankan      html  css  js  c++  java
  • String.Split


    public
    static class StringHelper { /// <summary> /// convert string to list by separators /// </summary> /// <param name="str">the string you want to deal with</param> /// <param name="separators">the separator char array </param> /// <returns></returns> public static List<string> StringToListBySeparators(this string str, char[] separators) { string[] strs = str.Split(separators); List<string> liststr = new List<string>(strs); return liststr; } /// <summary> /// convert string to list by separators /// </summary> /// <param name="str">the string you want to deal with</param> /// <param name="separators">the separator string </param> /// <returns></returns> public static List<string> StringToListBySeparators(this string str, string separators) { string[] strs = Regex.Split(str, separators, RegexOptions.IgnoreCase); List<string> liststr = new List<string>(strs); return liststr; } /// <summary> /// convert string to list by separators /// </summary> /// <param name="str">the string you want to deal with</param> /// <param name="separators">the separator char </param> /// <returns></returns> public static List<string> StringToListBySeparators(this string str, char separators) { string[] strs = str.Split(separators); List<string> liststr = new List<string>(strs); return liststr; } }
  • 相关阅读:
    牢骚
    【题解】LFYZNoip前水题赛 T6
    【模板】 ST表
    【模板】高精度。。。。。
    【模板】堆优化 + dij +pair 存储
    【模板】树状数组
    近两天目标
    当堆遇到STL 代码焕发光芒
    【模板】并查集
    【NOI2000】 单词查找树
  • 原文地址:https://www.cnblogs.com/bianlan/p/3075186.html
Copyright © 2011-2022 走看看