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>
Attribution to: highfive
Possible Suggestion/Solution #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.
Attribution to: highfive
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/33655