# determining NSString-length



## neo36 (Mar 27, 2003)

i'm taking my first steps with cocoa, at the moment and i need some help with string operations.

is there a method (i'm sure there is  to determine the length of a NSString object?
does anybody know some good (online?) reference on Cocoa, you know, something where you can look up thinks like that...

thanks in advance...


----------



## lurk (Mar 27, 2003)

Did you look in the docs in the /Developer directory.  There is lots of stuff there.

As to your specific question the answer is "length" which returns an unsigned int.  You may also be interested in length which returns the length of the NSString as a c string.  These two values need not be the same if you are using multibyte character strings or other funky stuff.

Finally for easy browsing I use Appkido which I think you can get from here http://homepage.mac.com/aglee/downloads

-Eric


----------



## jeremys (Apr 3, 2003)

int length=[NSString *string length];

hope that helps.


----------

