*! version 1.0.0  02/02/93  STB-13: dm13.1
program define trimblnk
	version 3.0
	local varlist "req ex max(1)"
	local options if "opt"
	local options in "opt"
	parse "`*'"

	local v "`varlist'"
	tempvar col
	quietly {
		replace `v'=trim(`v') `if' `in'
		compress `v'
		gen byte `col'=index(`varlist',"  ") `if' `in'
		capture assert `col'==0 | `col'==.
		while _rc {
			replace `v'=substr(`v',1,`col') + /*
			*/ substr(`v',`col'+2,.) if `col'!=0 & `col'!=.
			replace `col'=index(`varlist',"  ") `if' `in'
			capture assert `col'==0 | `col'==.
		}
		compress `v'
	}
end