Description Usage Arguments Value Author(s) See Also Examples
Tests if two string regions are equal.
1 2 | ## S3 method for class 'String'
regionMatches(this, toffset, other, ooffset, len, ignoreCase=FALSE, ...)
|
toffset |
The starting offset of the subregion in this string. |
other |
The other string. |
ooffset |
The starting offset of the subregion in the other string. |
len |
The number of |
ignoreCase |
If |
Returns TRUE
if the specified subregion of this string matches
the specified subregion of the other string, FALSE
otherwise.
Henrik Bengtsson (http://www.braju.com/R/)
*compareTo()
,
*equals()
, *equalsIgnoreCase()
1 2 3 4 5 6 7 8 9 10 11 12 13 | s1 <- String("Hello world!")
s2 <- String("Oh, hello there!")
regionMatches(s1, 1, s2, 5, 5) # TRUE
regionMatches(s2, 5, s1, 1, 5) # TRUE
regionMatches(s1, 0, s2, 4, 5) # FALSE
regionMatches(s1, 0, s2, 4, 5, TRUE) # TRUE
s1 <- "Hello world!"
s2 <- "Oh, hello there!"
regionMatches(s1, 1, s2, 5, 5) # TRUE
regionMatches(s2, 5, s1, 1, 5) # TRUE
regionMatches(s1, 0, s2, 4, 5) # FALSE
regionMatches(s1, 0, s2, 4, 5, TRUE) # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.