From: Binome on 28 Apr 2010 04:30 Hi, I'd like to delete spaces from a string. I have 2 strings "111" and "111", I use concat to get "111 111" and now I want to get "111111". Does someone know what instruction I need? Thx
From: Uwe Klein on 28 Apr 2010 04:50 Binome wrote: > Hi, > I'd like to delete spaces from a string. > I have 2 strings "111" and "111", I use concat to get "111 111" and now > I want to get "111111". > Does someone know what instruction I need? > > Thx you don't want conat. append res "111" "111" puts stderr res:$res ?? uwe
From: Binome on 28 Apr 2010 05:17 Uwe Klein a �crit : > Binome wrote: >> Hi, >> I'd like to delete spaces from a string. >> I have 2 strings "111" and "111", I use concat to get "111 111" and >> now I want to get "111111". >> Does someone know what instruction I need? >> >> Thx > you don't want conat. > > > append res "111" "111" > > puts stderr res:$res > > ?? > uwe I thank you. It's great.
From: Glenn Jackman on 28 Apr 2010 11:18 At 2010-04-28 04:50AM, "Uwe Klein" wrote: > Binome wrote: > > Hi, > > I'd like to delete spaces from a string. > > I have 2 strings "111" and "111", I use concat to get "111 111" and now > > I want to get "111111". > > Does someone know what instruction I need? > > > > Thx > you don't want conat. > > > append res "111" "111" > > puts stderr res:$res To explain why: [concat] is a list command -- concatenate 2 (or more) lists. The space you see is a due to the string representation of the resultant list. [append] is for strings specifically. -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous
From: Jeff Godfrey on 28 Apr 2010 11:39 Binome wrote: > Hi, > I'd like to delete spaces from a string. While others have helped you with the *real* issue, when you really do have a need to modify the contents of a string (including the deletion of specified chars), [string map] is your friend. string map {" " ""} "this is my string" returns --> thisismystring Jeff
|
Next
|
Last
Pages: 1 2 Prev: How to "make install" while not a root? Next: How to capture text in tk widget |