company logo

String :: mid - Get Substring

The function returns a sub string from the current string beginning at position iPosition (units). The encoding type of the string returned is taken from the current string.

When the iPosition exceeds the length of the current string length, the function returns an empty string. When iPosition is less than zero the function throws an exception.

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

Implementation overview

Implementation details

  1. Get substring with limited size
    odaba::String String  :: mid ( int32 iPosition, int32 iCount )

    The function returns a sub string from the current string beginning at position iPosition (units). When there are less than iCount units available in the string, or if iCount is -1 (default), the function returns all units that are available starting from the specified position. Passing 0 in iCount returns an empty string.

    • iPosition - Position in collection

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

    • iCount - Number of items

      The value contains the number of items to be processed or stored in a collection.

  2. to list
  3. Get remaining part of string
    odaba::String String  :: mid ( int32 iPosition )

    The function returns the remaining part of the current string beginning at iPosition (units).

    • iPosition - Position in collection

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

  4. to list