Reputation: 31
I need cut off the .ogg from the end of a various strings
For example
v = bdorian.ogg
h = {}
h[1] = v
How could I cutoff '.ogg' from the end of string v?
(A quick google search yielded no help)
Upvotes: 0
Views: 2249
Reputation: 963
Well, you can take everything before the last period
v = "bdorian.ogg"
h = {}
h[1] = v:match("(.+)%..+$")
Upvotes: 5