Related questions
Lua String replace
How would i do this?
I got this:
name = "^aH^ai"
string.gsub(name, "^a", "")
which should return "Hi", but it grabs the caret character as a pattern character
What would be a work around for this? (must be done …
Split a string using string.gmatch() in Lua
There are some discussions here, and utility functions, for splitting strings, but I need an ad-hoc one-liner for a very simple task.
I have the following string:
local s = "one;two;;four"
And I want to split it on ";". I …
Finding '.' with string.find()
I'm trying to make a simple string manipulation: getting the a file's name, without the extension. Only, string.find() seem to have an issue with dots:
s = 'crate.png'
i, j = string.find(s, '.')
print(i, j) --&…