Subject: | |
From: | |
Reply To: | |
Date: | Tue, 24 Aug 1999 16:56:48 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Donna Garverick writes:
> i've got a little puzzler.... i've got a ci string variable
> that contains, depending on it's input value, 'n' words
> (where 'n' is >= 2 and < some reasonable number) separated
> by 'x' spaces (where 'x' is >= 1 and < some finite yet
> practical number). i'd like to reduce it to a string that
> would still contain 'n' words but where each word is
> separated by one space. 'repl' isn't exactly working....
> i'd rather not take the 'word' route since i'm unsure how
> many words are in the entire string.
Sure, I'll throw in yet another solution.
And just because 'repl' "isn't exactly working", let's make
that the foundation. :)
parm string_to_fix
#
setvar stf_final anyparm(!string_to_fix)
setvar stf_work stf_final
#
while setvar(stf_work, repl(stf_final," "," ")) <> stf_final
setvar stf_final stf_work
endwhile
#
echo And the result is:
showvar stf_final
--Glenn (not remembering if there's a "nice" way to display a string
with special chars without altering the string, hence showvar)
|
|
|