-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String.empty() documentation unclear #2432
Comments
Here is the definition: It returns true when the length of the string equals 0. Oftentimes with these types of questions the best thing to do is test it out yourself in Godot, its really quick and it saves someone else having to do it for you! No one can answer this off the top of their head anyway so it is very helpful for you to check yourself. Here is the output by testing:
Prints:
|
Thanks - the issue here is about ensuring clear documentation so others, especially newcomers, understand when to use what functions especially when there are multiple ways of doing the same thing. what I would like the documentation to say, considering its defition, is: |
My point was that no users can answer those questions. To get answers you should test it out, see if its faster, see if there are any edge cases and then submit a PR changing the documentation. I understand it is desirable to have such comprehensive information in the docs, I agree. But oftentimes, since you are the only person who currently wants to know, you'll have to figure out the answer yourself and then make a note either here or in a PR.
May a suggest a for loop testing this out a hundred thousand times with a printed time at the end? |
Should close godotengine/godot-docs#2432 (cherry picked from commit 2643b8f)
Should close godotengine/godot-docs#2432 (cherry picked from commit 2643b8f)
Godot 3.1.1
The documentation for String.empty() currently says:
but should specify if this is exactl;y the same thing as
if str==""
of it it is equivalent to C#'sstring.isNullOrWhitespace(str)
or some other behavior - and why you would use it instead ofif str==""
The text was updated successfully, but these errors were encountered: