用字符串拆分字符串 [英] splitting string with a string

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

问题描述

我有一个html页面,我将其重新存储并存储在一个字符串中,我希望

根据< tdelements拆分它。我知道只有你可以使用string.split分割

使用字符。另一个选择是遍历

和拆分。有没有其他方法可以使用字符串分割字符串

令牌本身?

谢谢,

I have a html page that I retrived and stored in a string and I want
to split it based on <tdelements. I know only way you can split
using string.split is using characters. The other option is traverse
and split. Is there any other way you can split a string using string
token itself?
Thanks,

推荐答案

7月30日下午3:24 *,CSharper< cshar ... @ gmx.comwrote:
On Jul 30, 3:24*pm, CSharper <cshar...@gmx.comwrote:

我有一个html页面,我已经重新访问并存储在一个字符串中,我希望

根据< tdelements拆分它。我知道只有你可以使用string.split分割

使用字符。另一个选择是遍历

和拆分。有没有其他方法可以使用字符串

令牌本身拆分字符串?
I have a html page that I retrived and stored in a string and I want
to split it based on <tdelements. I know only way you can split
using string.split is using characters. The other option is traverse
and split. Is there any other way you can split a string using string
token itself?



使用Regex.Split。


Jon

Use Regex.Split.

Jon


On 7月30日,6:24 * pm,CSharper< cshar ... @ gmx.comwrote:
On Jul 30, 6:24*pm, CSharper <cshar...@gmx.comwrote:

我有一个html页面,我将其重新存储并存储在一个字符串中我希望

根据< tdelements拆分它。我知道只有你可以使用string.split分割

使用字符。另一个选择是遍历

和拆分。有没有其他方法可以使用字符串

令牌本身拆分字符串?
I have a html page that I retrived and stored in a string and I want
to split it based on <tdelements. I know only way you can split
using string.split is using characters. The other option is traverse
and split. Is there any other way you can split a string using string
token itself?



是;使用String.Split。它有一个带有String的重载(不是

char)分隔符:


public string [] Split(

string []分隔符,

StringSplitOptions选项



Yes; use String.Split. It has an overload which takes String (not
char) delimiters:

public string[] Split(
string[] separator,
StringSplitOptions options
)


CSharper,


你看过RegEx课了吗?具体来说,RegEx类上的Split

方法?

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" CSharper" < cs ****** @ gmx.com写信息

新闻:57 ************************ ********** @ r66g2000 hsg.googlegroups.com ...
CSharper,

Have you taken a look at the RegEx class? Specifically, the Split
method on the RegEx class?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"CSharper" <cs******@gmx.comwrote in message
news:57**********************************@r66g2000 hsg.googlegroups.com...

>我有一个html页面,我将其重新存储并存储在字符串,我希望

根据< tdelements拆分它。我知道只有你可以使用string.split分割

使用字符。另一个选择是遍历

和拆分。有没有其他方法可以使用字符串分割字符串

令牌本身?

谢谢,
>I have a html page that I retrived and stored in a string and I want
to split it based on <tdelements. I know only way you can split
using string.split is using characters. The other option is traverse
and split. Is there any other way you can split a string using string
token itself?
Thanks,



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

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