Apply Kotlin string shorthands

Proprietary

Folds trim().isEmpty() into isBlank(), and prefers take/drop over substring indexing.

org.openrewrite.kotlin.stdlib.StringShorthands$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.stdlib.StringShorthands$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Use isBlank() instead of trim().isEmpty() on a String
  2. Use isNotBlank() instead of trim().isNotEmpty() on a String
  3. Use take(n) instead of substring(0, n) on a String
  4. Use drop(n) instead of substring(n) on a String