-
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 ago by
Yogesh.
-
This discussion was modified 6 years, 11 months ago by
Forcetalks.
-
This discussion was modified 7 years ago by
Log In to reply.
Popular Salesforce Blogs
Why Businesses Are Investing in AI Chatbot Development Services in 2026
With the increasing customer expectations and the digital interactions being the major mode of interaction, companies in 2026 are turning to the development services of…
Top 12 Salesforce Winter ’19 Features
It’s been a busy month for Salesforce. With the most awaited, world’s greatest tech conference, Dreamforce 2018 unveiling today and the launch of Winter ’19 Release, we are…
Reports & Dashboards For Salesforce Lightning Experience
First of all the question arises why do we need Reports & Dashboards In Salesforce for business purposes.There are various reasons from which I’m going…
Popular Salesforce Videos
What is Workflow Rule in Salesforce | Salesforce Interview Questions and Answers
What is Workflow Rule in Salesforce | Salesforce Interview Questions and Answers
How to Get Started on Your Salesforce Admin Certificate with Trailhead
In this video, Brad discusses how to get started with your Salesforce career using trailhead. He discusses how to create and validate your account, the…
Explain Standard Business Features of Salesforce?
Standard business features of Salesforce are Contact Management, Opportunity Management, Lead Management, Quote Management, Sales Management and Sales Forecasting. Watch the video to learn all…