↧
Answer by dzaima for Time to settle this: Java vs C++
QuadR, 19 bytes _(.) [A-Z] \u1 _\l& Try it online!
View ArticleAnswer by GammaFunction for Time to settle this: Java vs C++
Zsh -oextendedglob, 82 69 51 bytes <<<${1//(#m)(_?|[A-Z])/${${MATCH[2]:u}:-_$MATCH:l}} Try it online! Try it online! Try it online! Even if the flags count toward byte count, adding 14 bytes...
View ArticleAnswer by Uri Granta for Time to settle this: Java vs C++
Python 3, 95 bytes First golf in a while. Comments welcome. lambda s:"".join(["_"*(x!=(l:=x.lower()))+l,x.upper()][p=="_"]*(x!="_")for p,x in zip("."+s,s))
View ArticleAnswer by Sara J for Time to settle this: Java vs C++
Retina, 40 bytes T`l`L`_. (?<!_)([A-Z]) _$L$1 _(?=[A-Z]) Try it online! Explanation T`l`L`_. # Replace lowercase letters with uppercase letters when after an underscore (?<!_)([A-Z]) # Replace...
View ArticleAnswer by Arnauld for Time to settle this: Java vs C++
Node.js, 61 bytes Contains the unprintable character \x7F. s=>s.replace(/_.|[A-Z]/g,s=>Buffer(s[1]||''+s).map(x=>x^32)) Try it online! JavaScript (ES6), 72 bytes...
View ArticleTime to settle this: Java vs C++
Story In an unnamed company, some people use Java and some use C++. This was always a nuisance, and they kept on arguing which single language they should all be using. To settle the dispute, the...
View Article
More Pages to Explore .....