A
Al Cholic
Hello,
Im working with some imported text files and I need check where the
first 2 lines of text occur. The files can have white space in the
beginning, so I cant just do a split("\n") and take the first two
elements of the array. Im a bit confused about this stuff. Here is
what I've been trying to do with regular expressions, but no results
yet:
def find_first_two_lines(file)
/\S\n\S/.match(file)
end
If anyone has any ideas, please do share!
Thanks in advance!
Im working with some imported text files and I need check where the
first 2 lines of text occur. The files can have white space in the
beginning, so I cant just do a split("\n") and take the first two
elements of the array. Im a bit confused about this stuff. Here is
what I've been trying to do with regular expressions, but no results
yet:
def find_first_two_lines(file)
/\S\n\S/.match(file)
end
If anyone has any ideas, please do share!
Thanks in advance!