Here's an implementation that finds the kth index of a substring in a string in Swift:
main.swift638 chars19 lines
Here's an example usage of this function:
main.swift353 chars9 lines
This will output: "Found the 2nd index of world in hello world, world at index: 12"
gistlibby LogSnag