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
SalesRedSalesRed 

Equivalent of Substring Function in Visualforce pages

Hello,

 

In Apex there is the substring function.  I'm wondering, in Visualforce is there an equivalent.

E.G.  if I have a string 'testme:helloVal'.  I want to get the value of the string from the colon ";" to the end of the string.

How can do this within a Visualforce page (not in a controller).

 

I know there are functions such as "Right",  "LEN" etc that formula's use (e.g. with a workflow rule) and that some of these can be applied to visualforce, but I wasn't sure how I could make the above requirement work.

 

Any tips welcomed.

 

Thanks for your help!

Best Answer chosen by Admin (Salesforce Developers) 
vishal@forcevishal@force

See if this helps:

 

{!RIGHT('testme:helloVal',(FIND(':', 'testme:helloVal') + 1))}

 

 

Here, first we find the index number of ':', and then from Right we fetch the text based on that.

All Answers

vishal@forcevishal@force

See if this helps:

 

{!RIGHT('testme:helloVal',(FIND(':', 'testme:helloVal') + 1))}

 

 

Here, first we find the index number of ':', and then from Right we fetch the text based on that.

This was selected as the best answer
SalesRedSalesRed

Thank you for your help!

SFDHSFDH

I want to split a name that is selected from dropdown list box and make to create LEAD first name and Last name , how to do that so ??

 

eg : "Jonh ken" is the name ,

  • i want to split it like John for the first name and
  • Ken for the second name ,
  • Is it possible to use substring to do this , pls help

 

thanks in advance