Hi all, I have to change the string contained in _['sequence-item'] by removing the character "*" at the end of the string. There should be a solution by using a combination of _.string.replace and _.string.strip, but I need a hint how to put them together. Thankx Andreas
On Thu, 30 Aug 2001, Andreas Wandel wrote:
I have to change the string contained in _['sequence-item'] by removing the character "*" at the end of the string. There should be a solution by using a combination of _.string.replace and _.string.strip, but I need a hint how to put them together.
_.string.replace(_['sequence-item'], '*', '') Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
[Andreas Wandel]> I have to change the string contained in _['sequence-item'] by removing the
character "*" at the end of the string. There should be a solution by using a combination of _.string.replace and _.string.strip, but I need a hint how to put them together.
<dtml-var "_['sequence-item'][:-1]"> This shortens the string by 1, thus removing your character. Tom P
On Thu, Aug 30, 2001 at 04:14:27PM -0400, Thomas B. Passin wrote:
<dtml-var "_['sequence-item'][:-1]">
This shortens the string by 1, thus removing your character.
Or, in simpler syntax (untested): <dtml-in somesequence> <dtml-let item=sequence-item> <dtml-var "item[:-1]"> </dtml-let> </dtml-in> As a general rule, if I ever plan on using sequence-item during a loop, I just use 'item' instead, as shown above. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
participants (4)
-
Andreas Wandel -
Mike Renfro -
Oleg Broytmann -
Thomas B. Passin