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   Maarten buis <>
Subject   Re: st: how to avoid truncation when trimming a long string
Date   Sun, 12 Mar 2006 23:52:34 +0000 (GMT)

Does -local model trim("`model'")- work? Not evaluating a local macro (leaving the = sign out)
prevents the 256 character max to bite, but this depends on what is in the original `model' local.
If that already contains more than 256 characters than the truncation already occured earlier in
the program.

--- "reardon, sean f." <> wrote:
> 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?

between 1/2/2006 and 31/3/2006 I will be
visiting the UCLA, during this time the
best way to reach me is by email

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214

+31 20 5986715

Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail
*   For searches and help try:

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