-
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, 2 months ago by
Yogesh.
-
This discussion was modified 7 years, 1 month ago by
Forcetalks.
-
This discussion was modified 7 years, 2 months ago by
Log In to reply.
Popular Salesforce Blogs
Top 7 Reasons Companies Choose Salesforce Consulting Services for Growth
In the current highly competitive business environment businesses are constantly under the pressure to deliver superior customer experiences, simplify processes, and boost growth. Salesforce, the…
What are Global Picklist or Picklist Value Sets in Salesforce
A worldwide Picklist infers a picklist which you'll be able to access for all Salesforce objects. Because it was on the off chance simply making…
Popular Salesforce Videos
Opportunity Manager for Salesforce
Opportunity Manager for Salesforce - The first opportunity manager app that has taken the initiative of converting information and data in the form of user-friendly…
How Easy (or Difficult) is it to Transition from Salesforce Classic to Lightning Experience?
This video answers the question of: How Do You Transition Your Company from Salesforce Classic to Lightning Experience? ▪️ How difficult is it? ▪️ How long should…
How to Integrate Commerce, Marketing and Service Using Salesforce Customer 360
Developers, Integrators, Admins and Architects all work together to deliver projects that span multiple Salesforce products. Salesforce is making it simpler by providing native integration…