与えられた配列を持っている場合、与えられたスペースのテキストを正当化する方法はありますか?すべてのインデックスに空白を含む20文字が必要です。配列のインデックス内のテキストを均等化する
アレイの例
['Hello there champ',
'example text',
'one two three'
]
と、結果は
['Hello there champ',
'example text',
'one two three'
]
がどのようにこの最初の配列は以下のようにフォーマットを取得するために行うことができます(この例では20)、所定の長さに正当化されるだろう二番目?
あなたは、配列を1秒のようにフォーマットされている場合、あなたが見つけるだろうか、意味ですか? –
最初のような通常の配列が与えられたときには、文の通常の構造があり、次にそれを2番目のようにフォーマットする必要があります。 – Chipe
必要なスペースの数を決め、それらを既存のスペースと同じ数量で追加します。 – Titus