System.AnsiStringBase.Insert

From RAD Studio API Documentation
Jump to: navigation, search

C++

AnsiStringBase&  Insert(const AnsiStringBase& str, int index) _ALWAYS_INLINE {

Properties

Type Visibility Source Unit Parent
function public dstring.h System AnsiStringBase

Description

Inserts a specified string into the AnsiStringBase.

Insert inserts the string str into this AnsiStringBase beginning at the position index, where 1 is the first position in the string. It returns the resulting modified string.

If index is less than 1, it is mapped to 1. If it is past the end of the string, it is set to Length(), turning the operation into an append.

If the str parameter is an empty string, Insert does nothing.

Insert throws an EOutOfMemory exception if the method is unable to allocate enough memory to accommodate the new, longer string.

Note: The index parameter specifies the character, not the byte, when working with a multibyte character system.