lib/sugar-high/string.rb in sugar-high-0.4.6.2 vs lib/sugar-high/string.rb in sugar-high-0.4.6.3

- old
+ new

@@ -1,5 +1,16 @@ class String + def trim + self.strip + end + + def concat *args + args.inject(self) do |res, arg| + res << arg.to_s + res + end + end + # remove prefixed '-' signs, then allow any letter, number, underscore '_' or dash '-' def alpha_numeric self.gsub(/^\-+/, '').gsub(/[^0-9a-zA-Z_\-]+/i, '') end \ No newline at end of file