Make explicit that string comparison is by default case sensitive #109729
+18
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'.