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

        /// <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;
        }
 
posted @ 2005-09-08 11:24  jetz  阅读(690)  评论(0编辑  收藏  举报