一个更有用的拆分? [英] A more useful Split?

查看:55
本文介绍了一个更有用的拆分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一个简单,更有用的分割功能,它将用一个字符串分隔符分割,例如<<>"或////?

解决方案

您好mb:


您可以使用Regex类的拆分方法:
http://msdn.microsoft.com/library/de...plitTopic3.asp


-

Scott
http://www.OdeToCode.com


周六,2004年9月25日10:07:21 -0600,mb < mm@hotmail.com>写道:

我想知道是否有一个简单,更有用的分割功能,它将用一个字符串分隔符分割,如<>或//// - ?




" mb" < mm@hotmail.com>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

我是想知道是否有一个简单,更有用的分割功能,它将用一个字符串分隔符分割,如<>或////?




使用System.Text.RegularExpressions;


string strTest ="一个<> Two<><><>> ;;>
string [] astrTest = Regex.Split(strTest,"<>");



感谢!!


顺便说一句,正则表达式是什么。我一直称它为拒绝 :-)


" Mark Rae" <毫安** @ mark-N-O-S-P-A-M-rae.co.uk>在消息中写道

news:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

" MB" < mm@hotmail.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

我想知道是否有一个简单,更有用的分割功能,它将用一个字符串分隔符分割,如<>或////?



使用System.Text.RegularExpressions;

string strTest =" One<> Two<>三个<><>>;
string [] astrTest = Regex.Split(strTest,"<>");



I was wondering if there is an easy, more useful Split function that will
split with a string delimiter like "<>" or "////"?

解决方案

Hi mb:

You can use the Split method of the Regex class:
http://msdn.microsoft.com/library/de...plitTopic3.asp

--
Scott
http://www.OdeToCode.com

On Sat, 25 Sep 2004 10:07:21 -0600, "mb" <mm@hotmail.com> wrote:

I was wondering if there is an easy, more useful Split function that will
split with a string delimiter like "<>" or "////"?




"mb" <mm@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

I was wondering if there is an easy, more useful Split function that will
split with a string delimiter like "<>" or "////"?



using System.Text.RegularExpressions;

string strTest = "One<>Two<>Three<>Four<>Five";
string[] astrTest = Regex.Split(strTest, "<>");



THANKS!!

By the way, what does Regex stant for. I keep calling it "Rejects" :-)

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

"mb" <mm@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

I was wondering if there is an easy, more useful Split function that will
split with a string delimiter like "<>" or "////"?



using System.Text.RegularExpressions;

string strTest = "One<>Two<>Three<>Four<>Five";
string[] astrTest = Regex.Split(strTest, "<>");



这篇关于一个更有用的拆分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆