swapCase method

  1. @useResult
String swapCase()

Swaps upper-case and lower-case for each character.

Implementation

@useResult
String swapCase() => split(
  '',
).map((String ch) => ch.toUpperCase() == ch ? ch.toLowerCase() : ch.toUpperCase()).join();