string gfind?
string gfind?
Does the factorio lua lib contain that function? I can't call it during data.
Re: string gfind?
What do you mean when you say "I can't call it"? You didn't provide code. How do you call it? Do you call it correctly?
I've used gsub in data stage code (Capsule Ammo 0.1.5 data.lua L22). If gsub is available the gfind is as well.
Do you know when to use . and when to use : ? Was a while since I used Lua string library functions now but I imagine that this might trip you up.
I've used gsub in data stage code (Capsule Ammo 0.1.5 data.lua L22). If gsub is available the gfind is as well.
Do you know when to use . and when to use : ? Was a while since I used Lua string library functions now but I imagine that this might trip you up.
Code: Select all
local s = "hello"
local result
result = s:gfind(arg0, arg1, arg2)
result = string.gfind(s, arg0, arg1, arg2) -- alternative
Re: string gfind?
Removing the G allowed a call of string.find (). This looks to me like gfind is not included in the factorio string library pack.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: string gfind?
Do you mean string.gmatch? Factorio only offers native lua functions, there is no special "string library" included.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.