Stuff

Inserts a string into another string.

Syntax

Stuff(s1, n1, n2 [, s2 ])

Parameters

Parameter

Description

s1

The source string.

n1

The position in s1 to insert the new string s2.

If n1 is less than one, the function assumes the first character position. If n1 is greater than length of s1, the function assumes the last character position.

n2

The number of characters to delete from string s1, starting at character position n1.

If n2 is less than or equal to 0, the function assumes 0 characters.

s2 (Optional)

The string to insert into s1.

If you do not include a value for s2, the function uses the empty string.

Examples

The following expressions are examples that use the Stuff function:

Expression

Returns

Stuff("TonyBlue", 5, 0, " ")

Tony Blue

Stuff("ABCDEFGH", 4, 2)

ABCFGH

Stuff(Address[0], Len(Address[0]), 0, "Street")

This adds the word Street onto the end of the first occurrence of Address.

See also Len.

Stuff("members-list@myweb.com", 0, 0, "cc:"

cc:members-list@myweb.com

// Ethnio survey code removed