I have an email message which looks like this:
Hey how are you?
On Saturday sender@example.com wrote:
> something
> On Friday sender@example.com wrote:
>> previous thing
How would I remove the lines that start with > as well as lines that include email@example.com wrote
Should I even keep the “someone wrote” part as that could remove legitimate lines, maybe only removing that line if it’s the last line.
I’m trying this out:
message_filtered = message_txt.to_s.split("\n").each do |m|
if m[0] != ">" then
return m
end
end
puts message_filtered
I could push m to an array and then join that array with \n but i’m trying a shorter way.
Try
To remove lines that start with
>you can use: