Question on ":" and it's use, and it's terminology

Pretty much I’ve been using this “:”/Colon

ie. :setFillColor, yourString:sub(),

I’ve been using it, but I don’t have any idea how it works? Can anyone explain how “:” works, what’s it’s method in C#? What do you call it? =(other than a “colon”). I’m trying to replicate it’s use by creating my own module.

Thanks in Advance

Check

https://coronalabs.com/blog/2015/12/01/tutorial-understanding-the-colon-vs-dot-operator/

Hope this help:)

Thanks, now I understand, How do you use it in C#? or other languages? or is this exclusive only for Lua?

JavaScript does the same thing, except there is no : operator. If it’s an object call:

myObject.method( param1, param2)

The function will get a “this” object being equal to myObject passed in automatically. If you write a straight up function, there is no “this” for it.

Each object oriented language will have some kind of construct similar to this.

Check

https://coronalabs.com/blog/2015/12/01/tutorial-understanding-the-colon-vs-dot-operator/

Hope this help:)

Thanks, now I understand, How do you use it in C#? or other languages? or is this exclusive only for Lua?

JavaScript does the same thing, except there is no : operator. If it’s an object call:

myObject.method( param1, param2)

The function will get a “this” object being equal to myObject passed in automatically. If you write a straight up function, there is no “this” for it.

Each object oriented language will have some kind of construct similar to this.