Skip to contents

Extract a substring from a given start position to the position determined by subtracting endDiff from the string length.

Usage

substrEnd(x, start, endDiff)

Arguments

x

A character string from which the substring is extracted.

start

The starting position for the substring extraction.

endDiff

The difference to subtract from the string length to determine the end position.

Value

A substring of the input character string.

See also

Examples

substrEnd("12345", 1, 1)
#> [1] "1234"
substrEnd("12345", 1, 2)
#> [1] "123"
substrEnd("12345", 2, 3)
#> [1] "2"