-
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 4 years, 8 months ago by Yogesh.
- This discussion was modified 4 years, 7 months ago by Forcetalks.
Log In to reply.
Popular Salesforce Blogs
Salesforce for Nonprofits – Don’t miss out on these amazing benefits
Giving back has been part of the DNA of Salesforce. Since inception, the Global tech giant has been on a mission to empower Nonprofits through…
Navigating ERP Solutions: Custom Systems, Well-Known Providers, and Block-Based Approaches
Enterprise resource planning (ERP) software is used by companies to manage routine business operations like accounting, order and project management, risk management, compliance, and supply…
Salesforce Essentials: What Is It and Why You Need It
Every industry needs software that established a continuous connection with the clients. This is the reason why Salesforce is emerging as a leader in the…
Popular Salesforce Videos
Education Cloud in Salesforce
Education Cloud is a leading platform that empowers your institution to become a Connected Campus, so you can transform the student journey. With the power…
How to Translate/Override Custom Labels in Salesforce
In this video, you can see how to translate or override custom labels that come with installed managed packages in Salesforce.
How To Use Journey Builder In Salesforce Marketing Cloud | Salesforce Tutorial
How to use Journey Builder in Marketing Cloud. This video will cover the following points - 1. Introduction Get a brief introduction to Journey Builder…