Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
match lock, char solution in Clear category for Caps Lock by juestr
def caps_lock(text: str) -> str:
def inner():
lock = False
for c in text:
match lock, c:
case _, 'a': lock = not lock
case False, _: yield c
case True, _: yield c.upper()
return ''.join(inner())
Oct. 7, 2022