#!/bin/ash str_trim() { if [ $# = 0 ]; then tr '\n' '\r' | sed -r 's/^[[:space:]]+//;s/[[:space:]]+$//' | tr '\r' '\n' else printf "%s" "$*" | tr '\n' '\r' | sed -r 's/^[[:space:]]+//;s/[[:space:]]+$//' | tr '\r' '\n' fi } str_upper() { if [ $# = 0 ]; then tr 'a-z' 'A-Z' else printf "%s" "$*" | tr 'a-z' 'A-Z' fi } str_lower() { if [ $# = 0 ]; then tr 'A-Z' 'a-z' else printf "%s" "$*" | tr 'A-Z' 'a-z' fi }