offsetCopy()  strchr()

Chapter 5: General Objects and Methods

size()

description

Calculates the number of characters of data in a string.

Syntax

size();

Return value

Integer. Returns the number of characters in the string (0 if empty), if successful, and a negative number, if failed.

Usage

Pointer to object

Object

int count;

int count;

count = ps->size();

count = mystring.size();

Examples

Example 64

string mystr;
int num;
mystr = “abcdefg”;
num = mystr.size();
//num is now 7, the number of characters in mystr




Copyright © 2005. Sybase Inc. All rights reserved. strchr()

View this book as PDF