How would I split this file name. image-1.png-ad-en-Km-Image.txt so that the end result looks like this. (also to ignore the '.txt' at the end).
- image-1.png
- ad
- en
- Km
- Image
In other words I want to ignore the first hyphen (-). The first 'segment' will always end with .png or .jpg.
I would usually do it something like this but that first hyphen in the image name is throwing a bit of a spanner in the works.
var endOfName = name.LastIndexOf(".txt"); var names = name.Substring(0, endOfName).Split('-');