How to remove only trailing spaces of a string in Java and keep leading spaces?

前端 未结 10 1407
野的像风
野的像风 2020-11-30 01:37

The trim() function removes both the trailing and leading space, however, if I only want to remove the trailing space of a string, how can I do it?

10条回答
提交回复
热议问题