array length in Salesforce

Raj picture Raj · Aug 4, 2013 · Viewed 16.4k times · Source

I'm getting error "Error Error: AddIMRConroller Compile Error: Initial term of field expression must be a concrete SObject: LIST at line 21 column 23" from below line of code .

string[] str1 = imrTable.split('\r\n'); System.debug( str1.length);

Answer

Raj picture Raj · Aug 4, 2013

In salesforce , we need to use size() method instead of length . this is something different then Java :(