Skip to content

Commit

Permalink
Add example to split filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
trans authored and jnormore committed Jun 11, 2012
1 parent 5ac91e0 commit 40cc799
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/liquid/standardfilters.rb
Expand Up @@ -54,6 +54,10 @@ def truncatewords(input, words = 15, truncate_string = "...")
end

# Split input string into an array of substrings separated by given pattern.
#
# Example:
# <div class="summary">{{ post | split '//' | first }}</div>
#
def split(input, pattern)
input.split(pattern)
end
Expand Down

0 comments on commit 40cc799

Please sign in to comment.