You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In research of behaviors exposed by @jg-rp we have found interesting behaviors that are not documented in the docs site. These are typically not tested either by unit tests, but are part of Ruby implementation. Here are some examples:
split by space actually will remove empty entries before, in middle or in the end. Split by comma for example will only trim ending. For example, {{ ' a b c ' | split: ' '}} will return 3 values and {{ ',a,b,,c,' | split: ',' }} will return 5.
split by space treats newlines and other control characters as space as well.
first on a string will work - but only if using Rails or active_support string extensions. Same for last, size
newline_to_br actually replaces \r\n and \n. And interestingly, will retain the \n only.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In research of behaviors exposed by @jg-rp we have found interesting behaviors that are not documented in the docs site. These are typically not tested either by unit tests, but are part of Ruby implementation. Here are some examples:
{{ ' a b c ' | split: ' '}}
will return 3 values and{{ ',a,b,,c,' | split: ',' }}
will return 5.Beta Was this translation helpful? Give feedback.
All reactions