Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for How do I make the first letter of a string uppercase in JavaScript?

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
May 19, 2023 at 22:35 comment added InSync @ȘerbanGhiță The same would apply to 1boss. If matching an underscore is not the desired behaviour, use [A-Za-z-0-9] or [^\W_].
May 5, 2022 at 17:25 comment added Șerban Ghiță This is a good answer! There is a small caveat: \w Matches any alphanumeric character from the basic Latin alphabet, including the underscore. so replacing a word like _boss will yield _boss (from developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/…)
Jan 6, 2021 at 23:13 history edited Peter Mortensen CC BY-SA 4.0
Active reading.
Apr 29, 2019 at 18:01 comment added Christian Vincenzo Traina This should be the accepted answer, instead it's almost the last since SO keeps awarding outdated questions. Btw, it's better using /./ for two reason: /\w/ will skip all the previous not letter characters (so @@abc will become @@Abc), and then it doesn't work with not-latin characters
Jul 14, 2018 at 19:40 history answered Wolf CC BY-SA 4.0

AltStyle によって変換されたページ (->オリジナル) /