![[Kotlin]0パディングした文字列を返すExtension](https://www.yukiiworks.com/wp-content/uploads/2019/04/kotlin.png)
はじめに
KotlinにてInt型の数値を指定桁数でゼロパディングした文字列を返すExtensionを作成しました。
コード
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | /**  * 指定桁数で0パディングした文字列を返す  * @param length 桁数  * @return 0パディングした文字列  */ fun Int.zeroPadding(length: Int): String {     var target = this.toString()     val remaining = length - target.length     if (remaining > 0) {         for (i in 1..remaining) {             target = "0${target}"         }     }     return target } | 
拡張として作成することでInt型の変数でどこでも使えます!
![[Flutter]Navigatorで2つ前の画面に戻る方法](https://www.yukiiworks.com/wp-content/uploads/2020/08/flutter-300x144.png)
![[AWS]Node.jsでSSMパラメータストアの値を取得する](https://www.yukiiworks.com/wp-content/uploads/2020/03/aws-eyecatch-960x504-1-150x150.png)
![[iOS]Can’t end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.エラーについて](https://www.yukiiworks.com/wp-content/uploads/2019/09/Xcode-150x150.png)
![[Android][Kotlin]ToolBarのタイトルを消す方法](https://www.yukiiworks.com/wp-content/uploads/2019/10/android-studio-e1585186990750-150x150.jpg)
![[AndroidX対応]Error inflating class android.support.design.widget.BottomNavigationViewエラーについて](https://www.yukiiworks.com/wp-content/uploads/2019/04/android-150x150.jpg)
![[Docker]MacにてDockerをインストールする方法](https://www.yukiiworks.com/wp-content/uploads/2019/08/docker-logo-2-150x150.png)

![[Flutter]flutter_svgにてEXCEPTION CAUGHT BY SVG](https://www.yukiiworks.com/wp-content/uploads/2020/08/flutter-150x150.png)
![[Laravel]指定のレコードだけは先頭にして抽出する方法](https://www.yukiiworks.com/wp-content/uploads/2019/05/laravel-150x150.png)

 
 