company logo

String :: firstPosition - Locate first occurence of character in string

The function returns the index position of the first occurrence of the character passed in iValue.

Comparison depends on the string coding type of the calling string. The value passed must meet the encoding of the string to be searched.

When the character has been found,the function returns the absolute position (in units) of the character. When the value could not be found, the function returns -1.

Return value:  Position in collection ( int32  )

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

Implementation overview

Implementation details

  1. - internal feature (not documented)
    int32 String  :: firstPosition ( int32 iValue )
    • iValue - Integer value

      The value is passed as platform independent 32-bit integer value.

  2. to list
  3. - internal feature (not documented)
    int32 String  :: firstPosition ( odaba::String &cString )
    • cString - Constant string object

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

  4. to list