function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
virkvirk 

Substring in visual force

Hello All,

I want to get substring of a date string in visualforce page inside fullcalendar. Can someone please help how to get it? I am trying to use

{uniteActiviteATP.substring(6,10)};

where uniteActiviteATP is string type data from controller and having a date in side it.

thanks in advance.
Arunkumar RArunkumar R
Hi Virk,

Substring is supported in controller alone.

public string dateSplit{get;set;}

dateSplit = uniteActiviteATP.substring(6,10);

then Bind dateSplit varible in your visualforce page. You can directly get substring value in visualforce page.

Another way something like below,

<apex:page >
<apex:outputText value="{!LEFT(uniteActiviteATP,4)}"></apex:outputText>
<apex:outputText value="{!RIGHT(uniteActiviteATP,7)}"></apex:outputText>
</apex:page>