Reply
Regular Contributor
SalesRed
Posts: 139
0
Accepted Solution

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!

Trusted Contributor
vishal@force
Posts: 429
0

Re: Equivalent of Substring Function in Visualforce pages

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.

Vishal, Certified Developer and Administrator
Kudos a post if it helps, mark it as solution if it solves.
http://exploretheforce.blogspot.in
Regular Contributor
SalesRed
Posts: 139
0

Re: Equivalent of Substring Function in Visualforce pages

Thank you for your help!

Regular Visitor
SFDH
Posts: 2
0

Re: Equivalent of Substring Function in Visualforce pages

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