Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: decompose string


From   John Bunge <[email protected]>
To   [email protected]
Subject   st: decompose string
Date   Mon, 8 Mar 2010 18:55:42 +0100 (CET)

Dear all

I have a string variable v1. It contains names, e.g. "James" or "Valentine". I want to decompose v1 into string variables v2, v3, v4, ... that each contains one letter of v1.

The result:

*-----------begin example------------

v1              v2   v3   v4   v5   v6   v7   v8   v9 v10

James         J     a     m     e     s

Valentine   V    a      l      e     n     t       i      n    e

*-----------end example------------

Thanks.

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index