Statalist The Stata Listserver


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

Re: st: how to avoid truncation when trimming a long string


From   Rafal Raciborski <[email protected]>
To   [email protected]
Subject   Re: st: how to avoid truncation when trimming a long string
Date   Sun, 12 Mar 2006 18:55:28 -0500

remove the equals sign
rafal

Quoting "reardon, sean f." <[email protected]>:

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)
[email protected]
_____________________________



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



================
Rafal Raciborski
Graduate student
Department of Political Science
Emory University
301 Tarbutton Hall
1555 Dickey Drive Atlanta, GA 30322
404-378-9826 (home)
[email protected]
http://www.roofoos.net/


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index