Quantcast
Channel: Time to settle this: Java vs C++ - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 6

Answer by Arnauld for Time to settle this: Java vs C++

$
0
0

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

s=>s.replace(/_.|[A-Z]/g,s=>s[1]?s[1].toUpperCase():'_'+s.toLowerCase())

Try it online!


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>