Hello everyone,
in my dataset, I have some variables that have a leading space in the labels of variables.
If I use this code:
foreach v of varlist * {
local lbl: var label `v'
local lbl: subinstr local lbl " " "", all
label var `v' `"`lbl'"'
}
all the spaces are removed but I want to keep them and delete the leading space (if present). How can I do it?
in my dataset, I have some variables that have a leading space in the labels of variables.
If I use this code:
foreach v of varlist * {
local lbl: var label `v'
local lbl: subinstr local lbl " " "", all
label var `v' `"`lbl'"'
}
all the spaces are removed but I want to keep them and delete the leading space (if present). How can I do it?
Comment