substring.String: Gets a substring of this string

Description Usage Arguments Value Author(s) Examples

Description

Gets a substring of this string. The substring begins at the position beginIndex and extends to the character at position endIndex-1.

Usage

1
2
## S3 method for class 'String'
substring(this, beginIndex, endIndex=NULL, ...)

Arguments

beginIndex

The beginning index, inclusive.

endIndex

The ending index, exclusive.

Value

Returns the substring.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

Examples

1
2
3
4
  s <- String("Hello world!")
  substring(s, 6,11)                    # "world"
  substring(s, 6)                       # "world!"
  substring(String("Hello world!"), 6)  # "world!"

HenrikBengtsson/R.lang documentation built on May 8, 2019, 7:50 p.m.