Hi All,

I'd like to take a string like:


and cut it down to:


using DTML.

I've tried to count to the last "/", and then truncate the string with
ljust, like so:

<dtml-let strDirPathSize="_.string.rfind(strDirPath, '/')">
<dtml-let strDirPath="_.string.ljust(strDirPath, strDirPathSize)">

However, ljust/rjust won't truncate the string.

In the case above, I know that I want to truncate the string to 23
characters (/Computers/Data_Formats). Is there a way to accomplish this
in DTML? If not, any suggestions?

Thanks in advance,
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to