Module: MartSearch::StringExtensions
- Included in:
- String
- Defined in:
- lib/martsearch/string.rb
Instance Method Summary (collapse)
-
- (String) wrap(width = 80, sep = $/)
Wrap the String at the specified width.
Instance Method Details
- (String) wrap(width = 80, sep = $/)
Wrap the String at the specified width
12 13 14 15 16 17 18 |
# File 'lib/martsearch/string.rb', line 12 def wrap( width = 80, sep = $/ ) res = [] for i in 0 .. self.size / width res.push( self.slice( width * i, width ) ) end res.join( sep ) end |