summaryrefslogtreecommitdiff
path: root/doc/string/end_with_p.rdoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/string/end_with_p.rdoc')
-rw-r--r--doc/string/end_with_p.rdoc11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/string/end_with_p.rdoc b/doc/string/end_with_p.rdoc
new file mode 100644
index 0000000000..f959cf7aaa
--- /dev/null
+++ b/doc/string/end_with_p.rdoc
@@ -0,0 +1,11 @@
+Returns whether +self+ ends with any of the given +strings+.
+
+Returns +true+ if any given string matches the end, +false+ otherwise:
+
+ 'hello'.end_with?('ello') #=> true
+ 'hello'.end_with?('heaven', 'ello') #=> true
+ 'hello'.end_with?('heaven', 'paradise') #=> false
+ 'тест'.end_with?('т') # => true
+ 'こんにちは'.end_with?('は') # => true
+
+Related: String#start_with?.