Hi,
I've got a string variable, which should have 10 characters.
I need to add a "0" in the front of the string but only if the string is 9 characters long.
ex.
Var 1
0123456789
123456789
0123456789
I'm using replace var1= "0" + var1 but missing the part where I can depend the command to only occure if the string is 9 characters.
Any help is very much appreciated
Best
Charlotte
Related Posts with Adding character to string variable depending on the length of characters in the same string
Exporting variable's LabelHii All, I was trying to export variable's labels in excel using [export excel using "Data", firstro…
"already preserved" errorHi, I have been running a piece of code through various universe of assets and I am getting the "al…
Weight fire counts by its confidenceHi all, Please, could someone help me? I have satellite data with fires' location and for each fire …
logit vs probit in level/change specificationsDear all, I have to investigate the determinants of a certain ordinal dependent variable which can …
Sample 1: I have all data plus instrumental variables; Sample 2: I have all data but NOT the instrumental variables; What to do?Good morning, I am soliciting ideas of what you would do in the following situation: I have two wa…
Subscribe to:
Post Comments (Atom)
0 Response to Adding character to string variable depending on the length of characters in the same string
Post a Comment