Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Timeline for split and capitalize

Current License: CC BY-SA 4.0

17 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited Community Bot
Commonmark migration
May 14, 2018 at 8:14 comment added Arnauld @l4m2 Indeed. (Sorry, I missed your comment.)
May 14, 2018 at 8:10 comment added Arnauld @Downgoat D'oh. This may have been derived from an earlier version where it really was needed. Or (more probably), I'm just stupid. :) Thanks!
May 14, 2018 at 8:10 history edited Arnauld CC BY-SA 4.0
added the new test cases and saved 2 bytes
May 14, 2018 at 3:13 comment added Downgoat Your explanation says u < 1?a:b checks for empty string so why not just do u?b:a
May 13, 2018 at 16:58 comment added l4m2 s=>c=>s.replace(u=/./g,x=>u=x==c?'':u?x:x.toUpperCase())?
May 13, 2018 at 16:56 comment added l4m2 well i saw it's added after the comment
May 13, 2018 at 16:02 history rollback Arnauld
Rollback to Revision 2
May 13, 2018 at 15:55 comment added Arnauld @Shaggy By adding a +, we're not going to capitalize the right character anymore. (This works but is only 1 byte shorter than the original version.)
May 13, 2018 at 15:53 comment added Shaggy @l4m2, that's a new test case which changes the spec yet again. A + before the . in the RegEx will get around it.
May 13, 2018 at 15:32 comment added l4m2 fail !prob!!lem!s!Olved!!
May 13, 2018 at 15:20 comment added Arnauld @Shaggy Thanks! I've added it as a separate version, since the new rules are quite different from the original ones.
May 13, 2018 at 15:14 history edited Arnauld CC BY-SA 4.0
saved 11 bytes
May 13, 2018 at 15:06 comment added Shaggy 50 bytes. Or 47 if you don't bother taking the second input, which is irrelevant.
May 13, 2018 at 4:20 comment added Conor O'Brien consolation 56 bytes for s=>c=>s.replace(RegExp(c+".","g"),m=>m[1].toUpperCase()), since it doesn't work for special regex characters
May 12, 2018 at 14:52 history edited Arnauld CC BY-SA 4.0
added the commented version
May 12, 2018 at 14:24 history answered Arnauld CC BY-SA 4.0
toggle format

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