-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Docs: Link to GlobalScope string methods from String class ref #98473
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change seems fine to me
Huh we were actually just talking about this problem in the discord recently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D looks good
@@ -6,6 +6,7 @@ | |||
<description> | |||
This is the built-in string Variant type (and the one used by GDScript). Strings may contain any number of Unicode characters, and expose methods useful for manipulating and generating strings. Strings are reference-counted and use a copy-on-write approach (every modification to a string returns a new [String]), so passing them around is cheap in resources. | |||
Some string methods have corresponding variations. Variations suffixed with [code]n[/code] ([method countn], [method findn], [method replacen], etc.) are [b]case-insensitive[/b] (they make no distinction between uppercase and lowercase letters). Method variations prefixed with [code]r[/code] ([method rfind], [method rsplit], etc.) are reversed, and start from the end of the string, instead of the beginning. | |||
To convert any Variant to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To convert any Variant to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str]. | |
To convert any [Variant] to or from a string, see [method @GlobalScope.str], [method @GlobalScope.str_to_var], and [method @GlobalScope.var_to_str]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oop, missed this before merging, my b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I make another PR to fix or does this go in #91521 now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added it to the tracker since it seems to have been committed like this for a few weeks now. Ideally minor cosmetic mistakes like these shouldn't result in making a new PR fixing just that, but instead done in batches ^^
Thanks! |
Closes godotengine/godot-docs#10132. If this PR is not approved, the original issue should be closed as not planned.
Adds links to the
@GlobalScope
functionsstr()
,str_to_var()
, andvar_to_str()
from theString
class ref. These are the only three@GlobalScope
functions that are clearly related to strings, rather than just using strings incidentally.These three functions are of interest to users looking at the string documentation. These functions could just as easily have been implemented as static functions
String.from()
,String.to_var()
, andString.from_var()
. So it's due to implementation choices and the class reference's inflexibility that these functions are not currently shown on theString
class reference. All that, and the fact that at least one user noticed their absence in theString
class ref, makes them worth linking.I personally don't mind the status quo in which these functions are not linked from the
String
page. One way or another, this PR should close the original issue, as either implemented or not planned.