Dear statalists,
I have two problems on -string functions-.
1. I want to replace the second word in a string varible with another word. What is the right function?
I have looked up string functions. Unluckily, no findings.
BTW, I found -word()- was maybe useful for what I want to do. However, missing values were always caused when I applied.
For example,
clear
input str6 v1
123
abc
2da
end
l
g v2=word(v1,2)
The result window showed "(3 missing values generated)" .
Could anyone tell me why?
2.I have two string variables v1 and v2. I want to generate a new variable v3 as following.
v1 v2 v3
abc123 123 abc
ab45 b45 a
cdef67 f67 cde
How to deal with it?
Thank you for any help.
Best regards
Rose
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/