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
kumar_arunkumar_arun 

Can we use LEFT() function in Lightning component?

Hi All, I want to use LEFT() inside lightning component, so that I can get first letter of string. e.g- " let's say string is Salesforce  then i need letter S, I used this function in visualforce page like this, LEFT(Salesforce,1) . It works fine, And now i want to use this in to Lightning component. When i used this in my component it showing error!.
LBKLBK
Hi Kumar,

Did you mean you have used it in your APEX controller?

Or, in VF page within {!.....}?

It should work in Lightning Controller as well.

Can you please post the error you are getting?
Tarun J.Tarun J.
Hello Kumar,

If you are using it in component controller or component helper, you can use Javascript function to get the substring.

var str = "Salesforce";
var res = str.substring(0, 1);

-Thanks,
TK
kumar_arunkumar_arun
Hi LBK, I used this in Visualforce page directly. can we use that in lightning component directly.