Hi everyone, I would like to remove any spaces existing in one of my variables, please. How can I do that?
Look at my data below for variable "fuel". I have two "Ds" and two "Gs", but should have only one each:
Could anyone help me, please? I already tried -strltrim(fuel)-, -strtrim(fuel)- and -ustrrtrim(fuel)-, but doesn't work.
Thank you for your feedback!
Michael
Look at my data below for variable "fuel". I have two "Ds" and two "Gs", but should have only one each:
Code:
. tab fuel G/D | Freq. Percent Cum. ------------+----------------------------------- D | 24,452 53.63 53.63 D | 8 0.02 53.65 Elc | 120 0.26 53.91 Elec | 10 0.02 53.93 G | 20,709 45.42 99.35 GLP | 1 0.00 99.35 G | 2 0.00 99.36 H | 294 0.64 100.00 ------------+----------------------------------- Total | 45,596 100.00
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str4 fuel "G" "G" "G" "G" "G" end
Thank you for your feedback!
Michael
Comment