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

Quoting "reardon, sean f." <>:

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).



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)

*   For searches and help try:

Rafal Raciborski
Graduate student
Department of Political Science
Emory University
301 Tarbutton Hall
1555 Dickey Drive Atlanta, GA 30322
404-378-9826 (home)

*   For searches and help try:

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