lib/vbsmin.rb
# Remove extra spaces (several spaces between two keywords except in a string)
# More reliable than internal_space_old which use string replacement and string
# split
Remove extra spaces (several spaces between two keywords except in a string)
More reliable than internal_space_old which use string replacement and string
split
Remove extra spaces ( several spaces between two keywords except in a string ) More reliable than internal_space_old which use string replacement and string split
def internal_space(line)
    double_quote = 0
    previous_char = nil
    output = ''
    i = 0
    line.each_char do |c|
      double_quote += 1 if c == '"'
      output += c unless previous_char == ' ' && c == ' ' && double_quote.even?
      i += 1
      previous_char = c
    end
    return output
  end
def internal_space ( line ) double_quote = 0 previous_char = nil output = '' i = 0 line . each_char do | c | double_quote += 1 if c == '"' output += c unless previous_char == ' ' && c == ' ' && double_quote . even? i += 1 previous_char = c end return output end
Remove extra spaces (several spaces between two keywords except in a string)
More reliable than internal_space_old which use string replacement and string
split
Remove extra spaces ( several spaces between two keywords except in a string ) More reliable than internal_space_old which use string replacement and string split
# For each single quote, if there is an odd number of double quote before # we are in a string, but if there is an even number of double quote before # we are out of a string.
line
<not_specific>