How do I put a space in a string in Java?

Asked 2 years ago, Updated 2 years ago, 78 views

What is the easiest way to put a space in a string in Java? I think there's something in an API like StringUtil, but it doesn't come out when I look it up. Please teach me.

string java padding

2022-09-22 22:25

1 Answers

If you look at Apache StringUtils, there are methods called leftPad, rightPad, center, and repeat.

http://dev.anyframejava.org/docs/anyframe/plugin/optional/util-demo/1.0.0/reference/html/ch04.htmlSee here for reference.


2022-09-22 22:25

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.