-
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, 8 months ago by
Yogesh.
-
This discussion was modified 6 years, 8 months ago by
Forcetalks.
-
This discussion was modified 6 years, 8 months ago by
Log In to reply.