company logo

String :: truncate - Truncate string at the given position index

The function truncates the string at position passed in iPosition and returns a reference to the string.

If the specified iPosition exceeds the current string length, nothing is done. When iPosition is negative, the function throws an exception.

odaba::String str = "oadaba interface";

str.truncate(6);

// str == "odaba"

Notes:

alias to chop

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

Implementation details

odaba::String & String  :: truncate ( int32 iPosition )
  • iPosition - Position in collection

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