Is this possible to do it without function, or it's only one way to solve this problem??? (just use regular expression)
function switchcase(s , n, a, rv, i, c) {
n = split(s, a, //)
rv = ""
for (i = 1; i <= n; ++i) {
c = a
if (c ~ /[a-z]/) rv = rv toupper(c)
else rv = rv tolower(c)
}
return rv
}
{ print switchcase($0) }