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

Sean:
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.
HTH,
Maarten

--- "reardon, sean f." <[email protected]> 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

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
*
*   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