ClassExists(string)
Description
Section titled âDescriptionâThe ClassExists Lua function returns a boolean indicating whether the provided string is a class.
Arguments
Section titled âArgumentsâ- String:
A string containing a single word that could be a class.
-
Boolean:
The function returns a boolean.- True:
The provided word is a class. - False:
The provided input is not a class.
- True:
Example
Section titled âExampleâThis example asks if the word âDisplayâ is a class and returns proper feedback.
| Copy CodeLua |
| ``` |
| return function() |
-- Store a string with the class namelocal className = "Display"-- Check if the class exists and then provide proper feedbackif ClassExists(className) then Printf("The class '%s' exists", className)else Printf("The class '%s' does not exists", className)endend