Forum

> > CS2D > Scripts > Lua "Q" : the string.sub
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua "Q" : the string.sub

2 replies
To the start Previous 1 Next To the start

old Lua "Q" : the string.sub

script favor
User Off Offline

Quote
Hello ,

I want to ask do the string.sub has mathematical behavior ?
e.g :
1
2
3
if string.sub(1,8+2-5)=="!kick" then

	etc.....

Actually didn't knew that.

old Re: Lua "Q" : the string.sub

DC
Admin Off Offline

Quote
This is not related to that specific command at all. It's a general programming/scripting thing. You can do it everywhere.
Any parameter / value can either be a fixed value, a variable, a function call or a mathematical/logical expression (which can also contain other variables and function calls).

old Re: Lua "Q" : the string.sub

Avo
User Off Offline

Quote
What user DC said. You can easily do stuff like that:
1
2
if string.sub(aString, 1, string.len(aString) - 1)=="!kick" then
 (...)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview