Sha256: 81e83c4e6fb3f3561d93eecb4ea62d53f0cb6886f984d7e70ccc627d80f97857
Contents?: true
Size: 469 Bytes
Versions: 4
Compression:
Stored size: 469 Bytes
Contents
def compile_integers(input_file_contents) modified_file_contents = input_file_contents.clone input_file_contents.each_with_index do |line,index| matches = line.scan(/(([0-9]+_)+([0-9]+|$))/) unless matches.empty? matches.each do |match_arr| modified_file_contents[index] = modified_file_contents[index].sub(match_arr[0],match_arr[0].gsub("_","")) end end end return modified_file_contents end
Version data entries
4 entries across 4 versions & 1 rubygems