samedi 20 novembre 2021

How do I keep the dash in the humanize string

Keep dash for humanize hash key

  1. Replaces underscores with spaces if any.
  2. Capitalizes the first word.
  3. The left character and right character of the dash(-) is in Uppercase if any.

For example:

this_is_a_test -> This is a test

foo_bar -> Foo bar

rock-on-a-roll -> Rock-On-A-Roll

a_full-stack_dev -> A_Full-Stack_dev

Aucun commentaire:

Enregistrer un commentaire