Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: macro string extraction

From   Robert Duval <>
Subject   st: macro string extraction
Date   Sun, 4 Sep 2005 03:06:39 -0400

Hi all,

Does anybody knows how to extract a substring of an arbitrary string 
in order to place it into a macro?

More specifically, suppose i have a string "hey". I want the local
macro `first' to contain the string "h".

Can anybody recommend a way to do it?

In principle the macro extended function "piece" should do the trick,
however this function doesn't allow 1 1 (ones) as arguments (there is
a previous posting on this by StataCorp.)

Any help is greatly appreciated,

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index