Hello everybody!
I have a string variable labelled "X", which contains a series of numerical codes (e.g., 243 563453 21, 354 44 6, 23435 67, etc.).
I would need to remove all the spaces from each of these values.
Now, I have tried the standard subinstr function:
replace X = subinstr(X, " ", "", .)
but apparently this works only in case of letters, not with numerical characters. Could you please help me? I can't find the correct code.
Many thanks!
Kodi
Related Posts with How can I remove spaces in string variable
Help with hurdle modelHello - i'm having some trouble running a churdle model. I have observational data (4,800 observati…
Dummy for event in prior ten yearsThis is my first post, I hope I express myself and my question in an understandable manner. I have …
Truncate the continuous variable (0,1)Dear Stata Expert, May I seek your help in variable transformation? I need to truncate the variable…
Dynamic panel data - how to test coefficient stability?I have an unbalanced panel data and I want to run an ARDL model. The longest time-span is from 1950m…
Grouping Countries According To Level of GDP per capitaHello, I am very new to Stata and excuse me in advance if this is somewhat of an easy question to ta…
Subscribe to:
Post Comments (Atom)
0 Response to How can I remove spaces in string variable
Post a Comment