Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: decompose string

From   John Bunge <>
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------------


*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index