[lang-ref] ( trim ) ( bash )

@test "trim" {
	# ${text##+([[:space:]])}
	shopt -s extglob
	text=$'\n\t  abc  def\t  \n  '
	trimmed="$text"
	trimmed="${trimmed##+([[:space:]])}"
	trimmed="${trimmed%%+([[:space:]])}"
	echo "$trimmed"
	[ "$trimmed" = $'abc  def' ]
}