Length of String

M

Mr. X.

Hello.

What function resolves the length of a string ?
(I have tried String.length, strlen, ... but didn't find any).

Thanks :)
 
S

Stefan Ram

Mark Space said:
The answer is String.length(), but this is so basic, you
shouldn't asking questions like that here.

Non-static operations are sometimes written like this:
»String#length()«.

»String.length()« looks like a static operation.
 
M

Mark Space

Stefan said:
Non-static operations are sometimes written like this:
»String#length()«.

»String.length()« looks like a static operation.

Yup, I was unclear (and incorrect).

String s = new String();
s.length();

is called on the object, not the class. Possibly the OP knew what I
meant, but that was potentially a very confusing mistake I made.
 
R

Roedy Green

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top