strins

Insert a substring in a string

Description

strins( string[], const substr[], index, maxlength=sizeof string )

Inserts a substring into a string.

Parameters

string The string that will be manipulated
substr The string that will be inserted
index The location in string where the substr will be inserted. If 0, the substr will be prepended to string
maxlength (optional) The size of dest in cells

Return value

Returns 1 on success, 0 on failure.

Example usage

    new s{40} = "CatAnt";
    new b{20} = "Dog";
 
    strins(s, b, 3);  // returns 1
 
    // s now contains "CatDogAnt"