mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-02 16:45:12 -07:00
Document replace string filter
This commit is contained in:
@@ -298,7 +298,12 @@ module Liquid
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Replace occurrences of a string with another
|
# @public_docs
|
||||||
|
# @syntax {{ string | replace: string, substring }}
|
||||||
|
# @summary Replaces all occurrences of a string with a substring.
|
||||||
|
# @type filter
|
||||||
|
# @category string
|
||||||
|
# @return string
|
||||||
def replace(input, string, replacement = '')
|
def replace(input, string, replacement = '')
|
||||||
input.to_s.gsub(string.to_s, replacement.to_s)
|
input.to_s.gsub(string.to_s, replacement.to_s)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user