Counts number of pieces of a string separated by a pattern. If it's an empty string, returns 0. If the pattern isn't found, returns 1. If the pattern is found once, returns 2 (two pieces), etc.
Counts number of pieces of a string separated by a pattern. If it's an empty string, returns 0. If the pattern isn't found, returns 1. If the pattern is found once, returns 2 (two pieces), etc.