equals.String: Compares this string to the specified object

Description Usage Arguments Value Author(s) See Also Examples

Description

Compares this string to the specified object. The result is TRUE if and only if the argument is not null and is a String object or a character string that represents the same sequence of characters as this object.

Usage

1
2
## S3 method for class 'String'
equals(this, obj, ...)

Arguments

obj

The object to compared to.

Value

Returns TRUE if the the strings are equal, otherwise FALSE.

Author(s)

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

See Also

*equalsIgnoreCase(), *compareTo(), *regionMatches()

Examples

1
2
3
4
5
6
7
8
  s1 <- String("Hello world!")
  s2 <- String("hello world!")
  s3 <- String("Hello world!")

  equals(s1, s1)         # TRUE
  equals(s1, s2)         # FALSE
  equals(s1, s3)         # TRUE
  equals("abc", "ABC")   # FALSE

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