Flowdock
format_string(str) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/net/imap.rb, line 2709
      def format_string(str)
        case str
        when ""
          return '""'
        when /[\x80-\xff\r\n]/
          # literal
          return "{" + str.bytesize.to_s + "}" + CRLF + str
        when /[(){ \x00-\x1f\x7f%*"\\]/
          # quoted string
          return '"' + str.gsub(/["\\]/, "\\\\\\&") + '"'
        else
          # atom
          return str
        end
      end
Register or log in to add new notes.