Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Truncate Start Of String

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
clj83
Smarty Regular


Joined: 16 Oct 2009
Posts: 44

PostPosted: Thu Aug 04, 2011 8:19 am    Post subject: Truncate Start Of String Reply with quote

Hi,

Im not sure if this is possible but does anyone know a method to truncate a fixed number of characters off the start of a string. So for example

{$entry->foo|truncate:6:"":true}

Would reduce the string to 6 characters but I want to remove the first six characters and leave the rest of the string. Is this possible?

Thanks

Chris
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Thu Aug 04, 2011 12:40 pm    Post subject: Reply with quote

{$foo|substr:6|6} should give you 6 characters omitting the first 6 characters
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
clj83
Smarty Regular


Joined: 16 Oct 2009
Posts: 44

PostPosted: Thu Aug 04, 2011 1:38 pm    Post subject: Great Reply with quote

Excellent, that works perfectly. Thanks so much for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP