Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to deal with the hump of underlined string in String

Shulou Source: shulou.com Published: 2022-06-02 02:31:31 10月01日 Update

String how to deal with underlined string hump, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Private static Pattern linePattern = Pattern.compile ("_ (\\ w)"); / * underline to hump * / public static String lineToHump (String str) {str = str.toLowerCase (); Matcher matcher = linePattern.matcher (str); StringBuffer sb = new StringBuffer (); while (matcher.find ()) {matcher.appendReplacement (sb, matcher.group (1). ToUpperCase ());} matcher.appendTail (sb) Return sb.toString ();} is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Underline hump help character string clear content for this article novice more knowledge industry information information channel problem demand channel enter one learn Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Technology OPPO Reno Shulou Tech Info Linux