strput#

Purpose#

Lays a substring over a string.

Format#

y = strput(substr, str, off)#
Parameters:
  • substr (string) – the substring to be laid over the other string.

  • str (string) – the string to receive the substring.

  • off (scalar) – the offset in str to place substr. The offset of the first byte is 1.

Returns:

y (string) – the new string.

Examples#

// String receiving substring
str = "max";

// String to add
sub = "imum";

// Location to add new string
loc = 4;

// Build new string
y = strput(sub, str, loc);
print y;
maximum

Source#

strput.src