strrem()  toLower()

Chapter 5: General Objects and Methods

substr()

Description

Searches the string for pattern and returns the ordinal position of the first occurrence of pattern. The first character in a string is always at an ordinal position of 1. This method is case-sensitive.

Syntax

substr(string pattern);

Parameter

Description

pattern

Pattern for which to search. Can be a literal value or another string object.

Return value

Integer. Returns the ordinal position of the first occurrence of pattern, if successful, and 0, if failed.

Usage

Pointer to object

Object

int location;

int location;

pattern=”Something”;

pattern=”1234”;

location = ps->substr    (pattern);

location = mystring.substr    (pattern);





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

View this book as PDF