本文介绍了regex.split,我可以保留分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在基于文本分隔符拆分大文件,但是我不想要从字符串中留下的分隔符
。例如,如果我有一个字符串

" NAME:Bill TOWN:Helena NAME:Frank TOWN:Helena"

我想分开NAME:给我


s(0)=姓名:Bill TOWN:Helena

s(1)=姓名:Frank TOWN:Helena


***通过开发人员指南发送***

不要只是参加USENET ......获得奖励!

解决方案





I am splitting large files based on a text delimeter, but I don''t want
the delimeter left out of the string. For example if I had a string
"NAME: Bill TOWN: Helena NAME: Frank TOWN: Helena"
I would want to split on NAME: giving me

s(0) = NAME: Bill TOWN: Helena
s(1) = NAME: Frank TOWN: Helena

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

解决方案





这篇关于regex.split,我可以保留分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 21:31