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 !

Ramchand RepalleRank #762 · 3K reputationPosted Dec 18, 2014, 4:09 AM EST
I have tried with the separators you mentioned above. It seems working fine..
Please check with dotnet fiddle code once: https://dotnetfiddle.net/Y6Js0D
Thanks,
Ramchand
jean tindel5 reputationPosted Dec 18, 2014, 4:34 AM EST
yeah your solution works fine but my input file is not in "raw" if you know what i mean, i am using "string alltext = File.ReadAllText( string PathOfFile)"
and in this case, where should i write the "@" ?
VulpesRank #55 · 29.2K reputationPosted Dec 18, 2014, 5:09 AM EST
jean tindel5 reputationPosted Dec 18, 2014, 5:17 AM EST
VulpesRank #55 · 29.2K reputationPosted Dec 18, 2014, 5:31 AM EST