# -*- coding: utf-8 -*-
# Methods added to this helper will be available to all templates in the application.
module Comm
  module Helpers
    module ApplicationHelper
      def truncate_str(str, length)
        jstr = str.gsub(/[\s　]+/,'').split(//u)
        if(jstr.length > length)
          jstr = jstr[0..length-2].to_s + '...'
        end
        return jstr
      end
    end
  end
end
