I'm looking to take a variable and take the last few letters from it's contents, but doing the way you get a specific letter out of a string (("string",1,1)
) doesn't work for a variable. Can someone tell me the syntax for doing that?
There is a table series called "string" (commonly used), to configure string values. In your case, you would want to use string.sub(target string,start of section number,end of section number). For example, ``` local var1 = "pineapple" local var2 = string.sub(var1,5,7) print(var2) --Should print "app"