-
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 5 years, 2 months ago by Yogesh.
- This discussion was modified 5 years, 2 months ago by Forcetalks.
Log In to reply.
Popular Salesforce Blogs
Tips to Prepare Your Salesforce Data for a Perfect AI Integration
Salesforce is the finest Customer Relationship Management (CRM) software available today. It lets you keep a proper track of customer interactions and sales data. However, leveraging this…
Why ISVs Must Strive Harder To Be On AppExchange?
Are you on Salesforce AppExchange? How many apps do you have on Salesforce AppExchange? If you are an ISV then you must be pretty aware…
Marketing Cloud Overview in 2024
This article explores Salesforce Marketing Cloud, the exclusive Einstein-powered marketing platform built on the world's most trusted CRM. Designed to foster lasting customer relationships, it…
Popular Salesforce Videos
A day at Dreamforce Event!
Time to share with you all the Algoworks Experience at Dreamforce 2019. The fun at Dreamforce was unparalleled, come relish the Dreamforce week with us!…
Which Objects are in the Salesforce Sales Cloud and Service Cloud?
In this video, We run through some of these diagrams. We'll also discuss some of the particular objects that you'll need to become familiar with as you…
Developer Life in India | An Interview with Salesforce Chef
Timecode: 00:00 Introduction 01:10 Who is Amit Singh? 01:56 Amit has interesting projects 03:58 Amit does technical content, but he is still popular. How? 05:45…