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

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

$
0
0

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 any uppercase letter not following an underscore
_$L$1              # with an underscore followed by the lowercase version of that letter
_(?=[A-Z])         # Replace an underscore followed by an uppercase letter
                   # with nothing

Viewing all articles
Browse latest Browse all 6

Trending Articles