解析空白符(空白,制表)分隔的字串

        /// <summary>
        
/// 解析空白符(空白,制表)分隔的字串
        
/// </summary>
        
/// <param name="strs"></param>
        
/// <returns></returns>

        public static ArrayList GetStringsSepByBlank(string strs) 
        

            ArrayList ar
=new ArrayList();
            
            
//[^\s]+表示1一个以上的非空白符,+至关重要;/s表示空白符;
            Regex re=new Regex(@"[^\s]+\s",RegexOptions.Multiline);    
            Match ma
=re.Match(strs); 
            
while(ma.Success)
            
{
                ar.Add (ma.Value ); 
                ma
=ma.NextMatch();
            }

            
return ar;
        }
 
原文地址:https://www.cnblogs.com/jetz/p/232339.html