Most of programming languages have substring or equivalent. I'm looking for a way to do this in Visualforce.
My requirement is adding a link to show a popup(show/hide div) to display a comment field which is some what lengthy. The content of the hyper link should be first 10 characters of the same comment field.

<a href="#" onclick="showNote('{!item.comment}');">{!item.comment}</a> 

1 Answer 1


This can be done with LEFT page variable function.

<a href="#" onclick="showNote('{!item.comment}');">{!LEFT(item.comment,10)}</a>   

There some other important page variable functions also out there in salesforce as described here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .