Posted by Bryan Oakley on 11/13/52 11:45
comp.lang.tcl wrote:
> I have a TCL proc that needs to convert what might be a list into a
> string to read
>
> consider this:
>
> [set string [PROPER_CASE {hello world}]]; # OUTPUTS Hello World which
> is fine for PHP
>
> [set string [PROPER_CASE {-hello world}]]; # OUTPUT {{-Hello}}
> World, which PHP will print literally as {{-Hello}} World, instead of
> -Hello World
>
> Is there an easy way for TCL to brute-force a list into a
> strictly-string-only format to prevent this potentially ugly display
> from being displayed by PHP/etc.?
To convert a list to a string with a space between each list element:
join $someList " "
So maybe you want:
[set string [join [PROPER_CASE ...] " "]
--
Bryan Oakley
http://www.tclscripting.com
Navigation:
[Reply to this message]
|