Skip to content

Instantly share code, notes, and snippets.

@xrrocha
Created December 16, 2020 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xrrocha/3f876d7cf55fb96623760e24e5b38715 to your computer and use it in GitHub Desktop.
Save xrrocha/3f876d7cf55fb96623760e24e5b38715 to your computer and use it in GitHub Desktop.
code block for README-28
package wscrambler
object WordScrambler {
private val WORD_REGEX =
"""\p{IsLatin}(\p{IsLatin})\1*(?!\1)\p{IsLatin}\p{IsLatin}+""".toRegex()
@JvmStatic // JVM static method
// CLI FQN: wscrambler.Scrambler
fun main(args: Array<String>) {
println(scrambleWords(
args.joinToString(" "))
}
fun scrambleWords(text: String) {
// Scrambling logic goes here...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment