I want to put the filename and the filetype in a array and I know the answer (split) but I don’t know how to look for the last dot before the extension begin.
Examples: Funny - SMS 02.jpg will get Funny - SMS 02in one array and jpg in another. But when I’m try to split the name of an file that already contains dots, the trouble begins. Funny - When you see it....jpg prints Funny - When you see it in for example fname[0] and jpg in fname[1].
How can I make it print Funny - When you see it... as fname[0] and jpg as fname[1]?
Thanks in advance.
?=is called ‘lookahead’ and basically means “followed by”. So, the above reads: “split by a dot if there’s no dots after it”.