As I said, there are separate functions that operate on the string itself, meaning there are functions for strings, and I’m not referring to string, something that has functions, but isn’t a type of string.
Unless I’m wrong and both of these accept the same parameters and function the same way.
Oh, they are the same. String is just a example/placeholder for any type of text that people use for undefined strings (string). local text = "Roblox", in this line, Roblox is what’s considered a string, and can be returned with string.sub. Or… i’m not understanding what you mean still if this isn’t the answer youre looking for
The real reason that works is because strings have a metatable; try =getmetatable("") in the command bar. You should see “The metatable is locked” or something along those lines. The metatable has an __index field which points back to the string library. Knowing that a:b(...) is syntactic sugar for a.b(a, ...) (the former passes itself as first argument implicitly), now you know why it works. string.f(str, ...) is usually recommended over str:f(...) due to it performing a little better, and getting better linting for incorrect use of the functions I believe. I personally use the shortcut on non-literals, as the difference is usually negligible. And that shortcut exists, so it would be a waste to not use it. It doesn’t severely harm readability either.