How do I get the first ten characters of a string?
<dtml-let myTest="'some really senseless blah'"> <dtml-var *first 10 characters of myTest*> </dtml-let> I couldn't find the solution anywhere... TIA Lars
On Fri, 23 Feb 2001, Lars Heber wrote:
<dtml-let myTest="'some really senseless blah'"> <dtml-var *first 10 characters of myTest*> </dtml-let>
Hint: how would you do this in pure Python? :) Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
Lars Heber <Lars.Heber@t-systems.de> writes:
<dtml-let myTest="'some really senseless blah'"> <dtml-var "myTest[:10]"> ... <dtml-var "myTest[-10:]"> </dtml-let>
the second one extracts the final 10 characters.
I couldn't find the solution anywhere...
Knowing Python helps alot. HTH Siggy
participants (4)
-
Chris Withers -
Lars Heber -
Oleg Broytmann -
Siggy Brentrup