You need to sign in to do that
Don't have an account?

string length not compiling?
When compliing the following code:
String test = 'test';
Integer len = test.length;
I get a compile error on the second line "Initial term of field expression must be an SObject: String".
Why can't I use the string length attribute?
String test = 'test';
Integer len = test.length();
Should work.
All Answers
String test = 'test';
Integer len = test.length();
Should work.
Thanks. Sorry. To used to c# and javascript. Why is it a method though?????