Function to_alternating_case

Source
pub fn to_alternating_case(s: &str) -> String
Expand description

Define String.prototype.toAlternatingCase (or a similar function/method such as to_alternating_case/toAlternatingCase/ToAlternatingCase in your selected language; see the initial solution for details) such that each lowercase letter becomes uppercase and each uppercase letter becomes lowercase.

§Example

"hello world".toAlternatingCase()
returns “HELLO WORLD”