method

strip_value

ruby latest stable - Class: CSV::Parser

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

strip_value(value)
private

No documentation available.

# File lib/csv/parser.rb, line 1019
    def strip_value(value)
      return value unless @strip
      return nil if value.nil?

      case @strip
      when String
        size = value.size
        while value.start_with?(@strip)
          size -= 1
          value = value[1, size]
        end
        while value.end_with?(@strip)
          size -= 1
          value = value[0, size]
        end
      else
        value.strip!
      end
      value
    end