Length of a string in bytes.

Length of a string in bytes. This function ascertains how long a string is by searching for the concluding 0. Use strlen, if you need to count the number of (UTF8-) letters in the string. If the string is not 0-terminated, the call can lead to significant errors. This function does not give a response to how much memory is reserved for a string, this is something the script programmer should pay attention to him/herself.

Name Type Default Description
Return int   Length of the string in bytes without the concluding 0
s char* - 0-terminated string
Preconditions
s must be 0-terminated
#include "internal/text.h"

Copy the current text to a minimal char* buffer.

#include "internal/text.h"
int main () { char * buffer = 0; String str = string::alloc ();
frame::gettext(gFrame, str, 0, -1, kExportPlain); buffer = alloc (strsize (string::get (str)) + 1); strcpy (buffer, string::get (str)); wlog ("", "%s\n\n", buffer);
string::release(str); release(buffer);
return 0; }

Since
Version 3.2 R2300, 11.02.2011

Available
priint:comet InDesign® Plug-Ins, comet_pdf, Illustrator

See Also
strlen

Alphabetic index HTML hierarchy of classes or Java