-
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 6 years, 3 months ago by
Yogesh.
-
This discussion was modified 6 years, 3 months ago by
Forcetalks.
-
This discussion was modified 6 years, 3 months ago by
Log In to reply.
Popular Salesforce Blogs
Best Salesforce Winter'18 Features
Salesforce is known for its best CRM services in the world. The recent incorporation of Artificial Intelligence (AI) technology had led Salesforce towards many new…
A Step-by-step Guide to Successfully Implement Salesforce
Salesforce is one of the world’s most prevalent and persuasive Customer Relationship Management (CRM) solutions for marketing, sales, and service. Being one of the leading CRM systems in the…
Benefits of Hiring a Salesforce Managed Services Provider
Salesforce is among one of the most powerful and versatile business tools currently available. It can help businesses of all sizes streamline their processes and…
Popular Salesforce Videos
Stay Focused with Salesforce Customer 360
It's never easy to stay focused when distractions are pouring in from work, home, and everywhere in between. That’s why Salesforce Customer 360 helps business…
Boosting your Application's Marketing through Salesforce AppExchange
Explore the key benefits of AppExchange, the largest business app marketplace, and discover how you can tap into its vast ecosystem of potential customers. In…
3 Easy to Use Salesforce Field Service Dashboards | AblyPro- Live Webinar
Watch AblyPro's exciting webinar video on Salesforce Field Service Reports & Dashboards. Discover how these powerful tools can drive efficiency and cut support costs for…