В основном вы должны сказать Stata устранить все пробелы, длина которых не превышает двух символов.
Для меня работает следующее:
clear
set obs 1
generate string = "Used: An item that has been used previously. The item may have some signs of cosmetic wear, but is fully" ///
+ " operational and functions as intended. This item may be a floor model or store return that has been used."
generate new_string = subinstr(string," ", "", .)
list
Обратите внимание, что я изменил " "
на" "
.