Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find n-th occurrence of delimiter in string
#1
I need to locate the substring between the 7-th to eighth occurrence of a delimiter (namely semi-colon) in the following string.

Quote:str s="Description;A;100;;;Y;Help;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"

Any advice is mostly welcome.

Let me add that I used tok but it misses any "empty" occurrence between to successive delimiters. I also tried findrx
Quote:findrx(subject pattern 0 4 a)
with cpMin, cpMax, but it fails in the case that the string contains unicode characters.

Many thanks in advance.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)