Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: how to avoid truncation when trimming a long string


From   "reardon, sean f." <sreardon@stanford.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: how to avoid truncation when trimming a long string
Date   Sun, 12 Mar 2006 15:38:25 -0800

colleagues --
i want to trim leading a trailing blanks off a string entered by a user
in a program -- the string is saved in local macro "model".  the string
may be very long (longer than 256 characters).

when i use the following line:

local model = trim("`model'")

this works fine as long as `model' is shorter than 256 characters.  when
longer, stata truncates the string (i think at 256 characters).  is
there an easy way to trim leading and trailing blanks from a long
string?  (i'm travelling, so don't have access to my manuals right now
-- so apologies if there's a ready answer in the manuals.  i couldn't
find anything on the statalist archives).

thanks,
sean.

_____________________________
 
sean f. reardon
associate professor of education and (by courtesy) sociology
school of education, CERAS building 
520 galvez mall, #526
stanford university
stanford, ca 94305-3084
650.736.8517 (office phone)
650.723.9931 (office fax)
sean.reardon@stanford.edu
_____________________________
 


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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