Skip to content

Instantly share code, notes, and snippets.

@mrenouf
Created December 1, 2025 20:02
Show Gist options
  • Select an option

  • Save mrenouf/53761f5dc1962b39c7e4b16ff1804a4b to your computer and use it in GitHub Desktop.

Select an option

Save mrenouf/53761f5dc1962b39c7e4b16ff1804a4b to your computer and use it in GitHub Desktop.
Kotlin String extension that should exist: `fun indexAfter(token: String): Int`
private fun String.indexAfter(token: String): Int {
return indexOf(token).let { if (it < 0) -1 else it + token.length }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment