aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_support_core_extensions.md
diff options
context:
space:
mode:
authorRashmi Yadav <rays.rashmi@gmail.com>2013-08-14 21:32:22 +0200
committerRashmi Yadav <rays.rashmi@gmail.com>2013-08-14 21:32:22 +0200
commita2aa1d434a5fe9a703eccb99d1a4a994bc4f5df4 (patch)
tree52f4cb5c0179b7962d20a61d5608b223988f5cda /guides/source/active_support_core_extensions.md
parent70d6e16fbad75b89dd1798ed697e7732b8606fa3 (diff)
downloadrails-a2aa1d434a5fe9a703eccb99d1a4a994bc4f5df4.tar.gz
rails-a2aa1d434a5fe9a703eccb99d1a4a994bc4f5df4.tar.bz2
rails-a2aa1d434a5fe9a703eccb99d1a4a994bc4f5df4.zip
Added docs for 'remove' method [ci skip]
Diffstat (limited to 'guides/source/active_support_core_extensions.md')
-rw-r--r--guides/source/active_support_core_extensions.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md
index 1915252122..fade836873 100644
--- a/guides/source/active_support_core_extensions.md
+++ b/guides/source/active_support_core_extensions.md
@@ -1249,6 +1249,17 @@ Calling `to_s` on a safe string returns a safe string, but coercion with `to_str
Calling `dup` or `clone` on safe strings yields safe strings.
+### `remove`
+
+The method `remove` will remove all occurrences of the pattern:
+
+```ruby
+"Hello World".remove(/Hello /) => "World"
+```
+
+There's also the destructive version `String#remove!`.
+
+NOTE: Defined in `active_support/core_ext/string/filters.rb`.
### `squish`
The method `squish` strips leading and trailing whitespace, and substitutes runs of whitespace with a single space each: