startsWith.String: Tests if the string starts with specified prefix

Description Usage Arguments Value Author(s) Examples

Description

Tests if the string starts with a prefix or not.

Usage

1
2
## S3 method for class 'String'
startsWith(this, prefix, ...)

Arguments

prefix

The prefix.

Value

Returns TRUE if the string starts with the given prefix, otherwise FALSE.

Author(s)

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

Examples

1
2
3
4
  s <- String("Hello world!")
  startsWith(s, "Hello")               # TRUE
  startsWith(s, "hello")               # FALSE
  startsWith("Hello world!", "Hello")  # TRUE

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