Apex outputtext value attribute

645    Asked by AugustinaFuentes in Salesforce , Asked on Jul 13, 2021

This is a generic question

apex:outputText value="{**0**,date,MM'/'dd'/'yyyy}"

What I wanted to know is what is the 0 in value used for in apex:outputtext?

Answered by Deepali singh

 Here, 0 tells you which argument index to merge in. So usually, you just have one argument, and merging it in uses the 0-index parameter. But you might for some reason have multiple arguments (each represented by an ). As represented by the above example, you can merge multiple arguments into one format string. It is very similar behavior to the String.format method in Apex, though I don't believe you can do date formatting that way.

Your Answer


Parent Categories