0 Members and 2 Guests are viewing this topic.
str = "My Name Is Jim"print(str:sub(2,8))print(string.sub(str, 2, 8))
Yup:Code: [Select]str = "My Name Is Jim"print(str:sub(2,8))print(string.sub(str, 2, 8))Two ways to do it Remember though, the first character is 1, not 0. (as in many other languages)And, the second arg is the position where you want to stop.More info here: http://lua-users.org/wiki/StringLibraryTutorial .Also, you could just post in the other topic. There is no need to create a new one just for this
You got tables.Tables are like the most incredible thing ever You can use them as arrays, dictionaries, anything. In fact, many stuff in Lua are based around tables.Just check this out: http://lua-users.org/wiki/TablesTutorial.