4th Floor, 4 Tabernacle Street London EC2A 4LU

Perl Substr

substr

This function supports three sets of passed values as follows:

[perl]
substr (STRING,OFFSET,LEN,REPLACEMENT)
substr (STRING,OFFSET,LEN)
substr (STRING,OFFSET)
[/perl]

The function:

substr (STRING,OFFSET)

returns all characters in the string after the designated offset from the start of the passed string. The function:

substr (STRING,OFFSET,LEN)

returns all characters in the string after the designated offset from the start of the passed string up to the number of characters designated by LEN. The function:

substr (STRING,OFFSET,LEN,REPLACEMENT)

Replaces the part of the string beginning at OFFSET of the length LEN with the REPLACEMENT string.