StringList :: indexOf - Find a string
The function returns the index position of the first occurrence of the string value passed in cString in the string list by searching forward.
Comparison depends on the string coding type of the calling string. When encoding types between strings differ, a copy of cString is created and recoded to the encoding type of the current string.
When the string has been found, the function returns the position (relative 0) of string within the string list. When the search string could not be found, the function returns -1 .
The position of an element in a collection is beginning with 0 for the first element.
Implementation overview
- Find string (case sensitive)
StringList :: indexOf ( cString ) - Find string
StringList :: indexOf ( cString, bCaseSensitive ) - Find string at position (case sensitive)
StringList :: indexOf ( cString, iPosition, bCaseSensitive ) - Find string at position
StringList :: indexOf ( cString, iPosition )
Implementation details
-
Find string (case sensitive)
int32 StringList  :: indexOf ( odaba::String &cString )
The function searches the string passed in cString from the top of the string list. Comparison is case sensitive.
- cString
- Constant string object
When iPosition exceeds the string length or when the string is empty, the the function returns -1 (lower).
to list
- cString
- Constant string object
-
Find string
int32 StringList  :: indexOf ( odaba::String &cString, bool bCaseSensitive )
The function searches the string passed in cString from the top of the string list. .
When bCaseSensitive is true (default), the search is case sensitive; otherwise the search is case insensitive.
- cString
- Constant string object
When iPosition exceeds the string length or when the string is empty, the the function returns -1 (lower).
- bCaseSensitive
- Case sensitive option
The option indicates case sensitive data in text ( true )
to list
- cString
- Constant string object
-
Find string at position (case sensitive)
int32 StringList  :: indexOf ( odaba::String &cString, int32 iPosition, bool bCaseSensitive )
The function searches the string passed in cString beginning at position iPosition . When the passed position is greater than the size of the string list ( size() ) the function returns -1 (not found). When iPosition is less than zero the function throws an exception.
When bCaseSensitive is true (default), the search is case sensitive; otherwise the search is case insensitive.
- cString
- Constant string object
When iPosition exceeds the string length or when the string is empty, the the function returns -1 (lower).
- iPosition
- Position in collection
The position of an element in a collection is beginning with 0 for the first element.
- bCaseSensitive
- Case sensitive option
The option indicates case sensitive data in text ( true )
to list
- cString
- Constant string object
-
Find string at position
int32 StringList  :: indexOf ( odaba::String &cString, int32 iPosition )
The function searches the string passed in cString beginning at position iPosition . When the passed position is greater than the size of the string list ( size() ) the function returns -1 (not found). When iPosition is less than zero the function throws an exception.
The search is case insensitive.
- cString
- Constant string object
When iPosition exceeds the string length or when the string is empty, the the function returns -1 (lower).
- iPosition
- Position in collection
The position of an element in a collection is beginning with 0 for the first element.
to list
- cString
- Constant string object