Kotlin Pad string Online
Pad text left/right/both to a target width.
Run details
The output updates as you type. The tool processes input in your browser.
Worked example
Width is a minimum size. The tool preserves longer strings and applies the fill to the selected side.
- Pad length
8- Pad string
"0"- Pad type
"STR_PAD_LEFT"
42
00000042
Using this operation in Kotlin
The interactive result uses JavaScript. Kotlin String APIs expose character indexes and case conversion. Check whether your code targets JVM, JS, Native, or Wasm when depending on platform-specific utilities.