offsetCat()  size()

Chapter 5: General Objects and Methods

offsetCopy()

Description

Replaces data in the string object with data copied from a source, starting at the offset. The first character in the source is always at an offset of zero.

Syntax

offsetCopy(string source, int offset);

Parameter

Description

source

Source from which to copy the data. This can be another string object or a literal, enclosed in double quotes.

offset

Location from which to begin copying data. The first character in a string or literal is always at offset zero.

Return value

Integer. Returns 1 for success, and 0 for failure.

Usage

Pointer to object

Object

ps->offsetCopy(“123abc”,3);

mystring.offsetCopy    (my_string_var, 5);

Examples

Example 63

string mystr;
string new_stuff;
mystr = “abcdefg”;
new_stuff = “123456789”;
mystr.offsetCopy(new_stuff, 3);
// mystr now contains "456789"




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

View this book as PDF