jean tindel

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 !
 
 
 
 
 
 
 
 

Answers (5)