in reply to Re^5: How can I count characters between two same substrings in a string where the substring is repeated more than 5 times?
in thread How can I count characters between two same substrings in a string where the substring is repeated more than 5 times?

Absolutely.

But, using your code assumes/requires prior knowledge of the string's content to decide whether to include or exclude Lines 4 and 5. Absent that knowledge, you have to add code to determine the locations of the first and last delimiter.

  • Comment on Re^6: How can I count characters between two same substrings in a string where the substring is repeated more than 5 times?