Add Ref: I have converted a dt to Dic
Datatable.AsEnumerable.ToDictionary(Function(x)x.Item(“Form Number”).ToString,Function(x)x.Item(“Form Title & Notes”).ToString)
If you’re not sure how many characters are before your “-”, you can use this regex:
\S*(?=-)
or this:
[A-z0-9]*(?=-)
If you are sure, we can be a bit more precise (let’s say you have 4 characters as in your given example) and use this regex:
\S{4}(?=-)
or this:
[A-z0-9]{4}(?=-)
Please let me know if you’re unsure of how to use the regex in it’s entirety.
You can always use this website if you want to play around with regex regex101: build, test, and debug regex