TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jean tindel
NA
5
1.3k
Regex and split
Dec 18 2014 8:31 AM
Hey everybody !
i've got some troubles to split a text, i need to split it according to chars, like "|" ," :" , or" \n", but i also need to split it according to Regex, and the method split(char[]) doesn't allow regex, when i try this :
string[] separators = { "|", "!", ":", "\n",
@"=...+"
}; string[] SplittedText = alltext.Split(separators,StringSplitOptions.RemoveEmptyEntries);
the last one doesn't work and my result array "splittedtext" still contains the lines with "========= ....." is there a solution except the fact to first split my text according to
@"=...+"
and then split it again according to "|", "!", ":", "\n" ???
THX !
Reply
Answers (
5
)
Extension Method modified
Yes Exceptions, well no but you know I got questions