company logo

StringList :: locate - Get string from string list

The function returns a string from the string list by key or position.

Return value:  String value ( odaba::String & )

Implementation overview

Implementation details

  1. Get string by name
    odaba::String StringList  :: locate ( odaba::String &cString )

    When the string list contains keyed strings (key parameters), parameter values may be accessed by name.

    Examples for key parameters:

    Name=Miller;FirstName=Paul;

    Name(Miller) FirstName(Paul)

    Name:Miller FirstName:Paul

    locate('Name') returns 'Miller'

    get('FirstName') returns 'Paul'

    • cString - Constant string object

      When iPosition exceeds the string length or when the string is empty, the the function returns -1 (lower).

  2. to list
  3. Get string at position
    odaba::String StringList  :: locate ( int32 iPosition )

    The function returns the string at position passed in iPosition from the string list. First string is at position 0. When iPosition exceeds the size of the string list, a null string will be returned ( String ::isNull() ).

    • iPosition - Position in collection

      The position of an element in a collection is beginning with 0 for the first element.

  4. to list