Skip to content
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.capitalize different output in C# and GDScript #60051

Closed
AndreSacilotto opened this issue Apr 9, 2022 · 3 comments
Closed

string.capitalize different output in C# and GDScript #60051

AndreSacilotto opened this issue Apr 9, 2022 · 3 comments

Comments

@AndreSacilotto
Copy link

Godot version

3.4.4

System information

Windows 10

Issue description

The C# version of string.Capitilize() has incorrect output. Which is different from the documentation and GDScript.

Problem: "capitalize camelCase mixed_with_underscores".Capitalize();
Expected: Capitalize Camel Case Mixed With Underscores
Received: Capitalize Camelcase Mixed With Underscores

Maybe can have something to do with #28748

Steps to reproduce

Write this in a _Ready function:

"capitalize camelCase mixed_with_underscores".Capitalize();

Minimal reproduction project

Not necessary?

@raulsntos
Copy link
Member

raulsntos commented Apr 9, 2022

Duplicate of #56941.

Fixed by #57076 but only in master, not in 3.x, probably because it's a breaking compatibility change.

@Calinou
Copy link
Member

Calinou commented Apr 9, 2022

Fixed by #57076 but only in master, not in 3.x, probably because it's a breaking compatibility change.

The different behavior is probably worth documenting in 3.x. Also, could the new behavior be made opt-in in 3.x (e.g. by passing an optional new_capitalize=true argument to .Capitalize() in C#)?

@Calinou Calinou added documentation and removed bug labels Apr 9, 2022
@Calinou Calinou added this to the 3.x milestone Apr 9, 2022
@akien-mga
Copy link
Member

I think this can be cherrypicked.

Duplicate of #56941

@akien-mga akien-mga modified the milestones: 3.x, 3.5 Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants