I am trying to find all the occurences of \"|\" in a string.
def findSectionOffsets(text):
startingPos = 0
endPos = len(text)
for position in te
text.find() only returns the first result, and then you need to set the new starting position based on that. So like this:
def findSectionOffsets(text):
startingPos = 0
position = text.find("|", startingPos):
while position > -1:
print position
startingPos = position + 1
position = text.find("|", startingPos)