Kotlinv2.1.21
  • Solutions
  • Docs
  • Community
  • Teach
  • Play
  • Home
  • Get started
  • Take Kotlin tour
  • Kotlin overview
  • What's new in Kotlin
  • Kotlin evolution and roadmap
  • Basics
  • Concepts
  • Data analysis
  • Platforms
  • JVM
  • Get started with Kotlin/JVM
  • Comparison to Java
  • Calling Java from Kotlin
  • Calling Kotlin from Java
  • Spring
  • Test code using JUnit in JVM – tutorial
  • Mixing Java and Kotlin in one project – tutorial
  • Using Java records in Kotlin
  • Java to Kotlin migration guides
  • Strings
  • Collections
  • Nullability
  • Standard input
  • Native
  • WebAssembly (Wasm)
  • JavaScript
  • Scripting
  • Develop with Kotlin Multiplatform
  • Standard library
  • Official libraries
  • API reference
  • Language reference
  • Tools
  • Compiler and plugins
  • Learning materials
  • Early access preview (EAP)
  • Other resources

Uh Oh!

Something went wrong.
Don’t worry, it’s not you — it’s us.
Sorry about that!

  • Strings in Java and Kotlin
  • Concatenate strings
  • Build a string
  • Create a string from collection items
  • Set default value if the string is blank
  • Replace characters at the beginning and end of a string
  • Replace occurrences
  • Split a string
  • Take a substring
  • Use multiline strings
  • What's next?
Contributing to KotlinReleasesPress KitSecurityBlogIssue TrackerBrand AssetsCareersKotlin MerchOpt-Out
Kotlin™ is protected under the Kotlin Foundation and licensed under the Apache 2 license.
Supported and developed by JetBrains