+def keep_100_lines(context)
- num = 0
- new_context = ''
- context.each_line do |line|
- new_context += line
- num += 1
- break if num > 99
- end
you do not need to handle it line by line, you can get the first 100 lines with: context.split("\n")[0,100].join("\n")
ok tried, seem it's doesn't not work let's me try it once more
--------- Thanks, Lu Weitao
Thanks, Luan Shengde
- new_context
+end
2.23.0