-
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
Using the runAs Method in Salesforce | Apex Developer Guide
By and large, all Apex code runs in framework mode, where the authorizations and record sharing of the current client are not considered. The framework…
Salesforce Experience Cloud Implementation Guide
Table of Contents Introduction Salesforce Experience Cloud Implementation Steps Planning and Preparation Setup and Configuration Content Management User Management and Security Integration and Automation…
Transform businesses with the power of Artificial Intelligence leveraged through Salesforce Einstein
Artificial Intelligence is powering next-generation customer experiences with smart predictions, intelligent recommendations, timely automation and much more. Gartner predicts that by 2020, a staggering 85% of…
Popular Salesforce Videos
Create an Email Alert Workflow Rule | Workflow Rules in Salesforce | Salesforce Automations
Configuring Workflow Rule Email Alerts or Notifications Follow. Workflow Rules are automatic processes that trigger an action when a certain event occurs, such as updating…
Develop a Basic Slack App For Salesforce
Build Slack Apps integrated with Salesforce. Use Heroku to host Slack apps built using Slack Bolt Framework and get connected to Salesforce using Node.js library…
Pardot vs Marketing Cloud: What's The Difference?
There are different functions of each Salesforce product according to the use cases. Many businesses get confused between Salesforce Pardot and Marketing cloud. Pardot is…