Converting / parsing a string into an IEnumerable(Of String)

  • Thread starter Thread starter wingers
  • Start date Start date
W

wingers

Guest
Hi

I receive input in the following format:-

".doc" "test.xls", ".doc","me.pdf" .doc "my file.txt"


Basically filenames or file extensions to exclude / include

I want to convert / parse them to a IEnumerable(Of String) to then use in my app

Notes:

Filenames could potentially have spaces in them e.g. "my file.txt"
Items could be separated by a space ( ), by a comma (,) or by a comma and space (, )
Strings could have quotes around or NOT have quotes around e.g. .doc ".doc"
Entries in string only need adding once so ignore any duplicates



I have tried RegEx but can't seem to meet all requirements (see other post - Help with RegEx or another solution)


Thanks




Darren Rose

Continue reading...
 
Back
Top