-
Why does NULL count as 4 characters in Salesforce Apex?
If I execute the block of code in the Anonymous window, it returns 8 as the length of the string. Do null string count towards the string length in Apex?
String s = 'Yosh';
String e = null;
String y = s + e;
System.Debug(y.trim().length()); //Returns 8 characters. Should return 4-
This discussion was modified 7 years, 1 month ago by
Yogesh.
-
This discussion was modified 7 years, 1 month ago by
Forcetalks.
-
This discussion was modified 7 years, 1 month ago by
Log In to reply.
Popular Salesforce Blogs
How to Use Salesforce Lightning Data Services
INTRODUCTION Lightning Data Service is a Lightning Component which behaves like a VisualForce Standard Controller in VisualForce Page to provide access to Database to display…
Agentforce vs Traditional Chatbots: Why AI Agents Are the Future of Support
In recent years support systems evolved rapidly. Traditional chatbots serve basic tasks using rules and flows. AI agents (also called “agentic AI” or intelligent agents)…
New release of Salesforce Marketing Cloud went live on June 17
Good news for all those who are eagerly waiting for Salesforce Marketing Cloud new release. With great new features and overall enhancements, the Salesforce Marketing…
Popular Salesforce Videos
How Customers Embrace Salesforce - Literally!
Get ready to giggle ???? Couldn’t get enough of the famous Key and Peele’s video doing the rounds on social media? Check out our version…
How to install Salesforce for Outlook in 2019
Watch this video to learn how to install Salesforce for Outlook. ? Also, we cover all the details in our blog post at https://ascendix.com/blog/integrating-salesforce-outlook/
Write Tableau CRM Data to Salesforce Objects
Use Tableau to blend Salesforce data from across the Customer 360 platform with your other business data for increased visibility and a deeper understanding of…