Skip to content

Conversation

@belzecue
Copy link

@belzecue belzecue commented Aug 18, 2025

The problem here is, if you click inside the Godot editor to go to the doco for e.g. String.begins_with(), it does not state in the method description if the search is case sensitive or not. You have to scroll up to the class description, and even then it's only inferred (as it is now) by talking about variant methods that are case insensitive. In my case, I just wanted a quick answer: is begins_with() case sensitive or not? It would be overkill to add this clarification to every string method description, so making it explicit in the class description is the best option, IMO.

"are reversed, and start from the end of the string, instead of the beginning."

This is misleading. The string itself is not 'reversed'; the meaning of the 'r' variant method is 'reverse' as in 'reverse search'. As is, the doco implies a string is first reversed and then searched from the end of the string, which would return the same as the non-r method! In my edit I did not explicitly state that the 'r' method variation stands for 'reversed' because it's implicit in the description of what the method does: start from the end of the string instead of the beginning. And there is no clarification right now in the class description for what 'n' means (I assume it means '[n]ot case sensitive'). But this could be made explicit in the edit if desired: i.e. that 'r' means 'reversed'.

@belzecue belzecue requested a review from a team as a code owner August 18, 2025 11:40
@AThousandShips AThousandShips added enhancement documentation cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Aug 18, 2025
@AThousandShips AThousandShips added this to the 4.x milestone Aug 18, 2025
@timothyqiu
Copy link
Member

I don't think this change will make much of a difference. Users will still need to know that they need to scroll to the top of the page to view the case-sensitive rules.

We can add the missing case-sensitivity information in the method description and add see-alsos pointing to the alternative versions directly. For example:

replacen
Replaces all [b]case-insensitive[/b] occurrences of [param what] inside the string with the given [param forwhat].
See also [method replace] for a case-sensitive version.

replace
Replaces all [b]case-sensitive[/b] occurrences of [param what] inside the string with the given [param forwhat].
See also [method replacen] for a case-insensitive version.

@belzecue
Copy link
Author

Agreed, the better solution is to place the information where the user ends up the most, which is within the method descriptions.

I'll review the individual method description updates needed and resubmit.

@belzecue belzecue marked this pull request as draft August 18, 2025 15:25
@belzecue belzecue force-pushed the 250818-class-string-case-sensitive branch from b647f19 to f0852b8 Compare September 6, 2025 13:43
@belzecue
Copy link
Author

belzecue commented Sep 6, 2025

Updated String method descriptions involving string comparison to explicitly indicate case sensitivity.
Rebased and squashed.
Further suggestions welcome.

@belzecue belzecue marked this pull request as ready for review September 6, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants