I am trying to find all the occurences of \"|\" in a string.
def findSectionOffsets(text): startingPos = 0 endPos = len(text) for position in te
If text is the string that you want to count how many "|" it contains, the following line of code returns the count:
text
"|"
len(text.split("|"))-1
Note: This will also work for searching sub-strings.