-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add support for StringName in len function #8774
Labels
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the project you are working on
A weird text based game
Describe the problem or limitation you are having in your project
len(&"test") throws an error, but is expected to return the length of the StringName, similar to how len("test") would show the length of the String. Strings and StringName can be used interchangeably in most other GDScript contexts however where len works for Strings, it does not work for StringNames.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Update the GDScript len function to also support returning the length of a StringName.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This would make len behave same for both Strings and StringNames, so you could do len(&"test") and get a result
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around using the StringName.length() function which does the same thing. However using len is the most common method and unexpectedly breaks for StringNames where all other string functions are shared between the two.
Is there a reason why this should be core and not an add-on in the asset library?
StringNames are core
The text was updated successfully, but these errors were encountered: