Sunday, March 12, 2006

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

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." <> 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: * * *


Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?