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