<dtml-var expr="some_string[3:9]"> ----- Original Message ----- From: Andres Corrada <andres@corrada.com> To: Dimitris Andrakakis <dandraka_info@yahoo.com> Cc: <zope@zope.org> Sent: Sunday, March 26, 2000 9:34 PM Subject: Re: [Zope] newbie question - handling strings Dimitris Andrakakis wrote:
Hi there, I've got an 8-character string, say str='12345678'. With <dtml-var str> ofcourse I get 12345678. How can I display only part of it ? Say the first 4 chars (1234) or the next 2 (56) or the last two (78). In python I know this can be done with something like str[:4], str[4:6] and str[6:]. Any help ? (Hope I didn't sound too newbish !). --- Dimitris Andrakakis http://atlas.central.ntua.gr:8000/~mc94068
<dtml-var "str[:4]"> or whatever else you want should work. ------------------------------------------------------ Andres Corrada-Emmanuel Email: andres@corrada.com Owner http://www.corrada.com/mamey Mamey Phone: (413) 587-9595 ------------------------------------------------------ _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )