Breaking Strings into chars that are in upper case

后端 未结 5 427
温柔的废话
温柔的废话 2021-01-14 18:46

I\'m making a method to read a whole class code and do some stuff with it.

What I want to do is get the name of the method, and make a String with it.

Someth

5条回答
  •  暖寄归人
    2021-01-14 19:04

    Don't bother reinvent the wheel, use the method in commons-lang

    String input = "methodName";
    String[] words = StringUtils.splitByCharacterTypeCamelCase(methodName);
    String humanised = StringUtils.join(words, ' ');
    

提交回复
热议问题