Generate fixed length Strings filled with whitespaces

后端 未结 13 975
借酒劲吻你
借酒劲吻你 2020-12-04 13:52

I need to produce fixed length string to generate a character position based file. The missing characters must be filled with space character.

As an example, the fi

13条回答
  •  一整个雨季
    2020-12-04 14:39

    The Guava Library has Strings.padStart that does exactly what you want, along with many other useful utilities.

提交回复
热议问题