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() error 'Stack overflow' #25

Closed
IZriouil opened this issue Jan 26, 2024 · 3 comments · Fixed by #26
Closed

String capitalize() error 'Stack overflow' #25

IZriouil opened this issue Jan 26, 2024 · 3 comments · Fixed by #26

Comments

@IZriouil
Copy link
Contributor

Using string_extension method capitalize() will trigger a Stack Overflow because of the recursive call to .capitalize() inside.

I believe that's just a small mistake:

/// Capitalize each word inside string
/// Example: your name => Your Name, your name => Your name
String capitalize() {
  if (isEmpty) return this;
  return split(' ').map((e) => e.capitalize()).join(' ');
}

We should use capitalizeFirst() instead of capitalize().

Good work guys, i like the package !

@becjit
Copy link

becjit commented Feb 12, 2024

Is this merged and released ? This is still happening in 2.0.12

@IZriouil
Copy link
Contributor Author

Well, I believe that the new version isn't deployed yet on pub.dev
@jayeshpansheriya, do u confirm ?
As a fix for now, u can use the git directly to get the package:

  awesome_extensions: 
    git: 
      url: https://github.com/jayeshpansheriya/awesome_extensions

it should work fine !

Repository owner deleted a comment from jayeshindianic Feb 28, 2024
@jayeshpansheriya
Copy link
Owner

Use 2.0.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants