| View previous topic :: View next topic |
| Author |
Message |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Tue Jan 24, 2017 4:20 pm Post subject: Replace element in list with white space |
|
|
The list is stored in the cursong variable
Example: if the cursong variable returns: Another&Brick&In&The&Wall&Pink&Floyd
To return: Another Brick In The Wall Pink Floyd
I try:
| Code: | | set cursong [string map [list "&" " "] $cursong] |
But, no work _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Jan 24, 2017 10:28 pm Post subject: Re: Replace element in list with white space |
|
|
| juanamores wrote: | The list is stored in the cursong variable
Example: if the cursong variable returns: Another&Brick&In&The&Wall&Pink&Floyd
To return: Another Brick In The Wall Pink Floyd
... |
<myhandle> .tcl split "Another&Brick&In&The&Wall&Pink&Floyd" &
<botnick> Tcl: Another Brick In The Wall Pink Floyd _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Jan 24, 2017 11:04 pm Post subject: Re: Replace element in list with white space |
|
|
| juanamores wrote: | The list is stored in the cursong variable
Example: if the cursong variable returns: Another&Brick&In&The&Wall&Pink&Floyd
To return: Another Brick In The Wall Pink Floyd
I try:
| Code: | | set cursong [string map [list "&" " "] $cursong] |
But, no work |
This does work.
<me> .tcl string map [list "&" " "] "Another&Brick&In&The&Wall&Pink&Floyd"
<botnick> Tcl: Another Brick In The Wall Pink Floyd _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri Jan 27, 2017 8:15 pm Post subject: |
|
|
There was another line in the script that modified the command.
Both solutions work perfectly
Thank you willyw!  _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
|