I am creating a python movie player/maker, and I want to find the number of lines in a multiple line string. I was wondering if there was any built in function or function I
SPAM\nEGGS\nBEANS = Three lines, two line breaks
SPAM\nEGGS\nBEANS
So if counting lines, use + 1, or you'll make a fencepost error:
x.count( "\n" ) + 1