How can I convert snake case to camel case in Java?
Input: "input_in_snake_case"
Output: "InputInSnakeCase"
Java uses CamelCase as a practice for writing names of methods, variables, classes, packages, and constants.
Guava supports this through its CaseFormat class
import com.google.common.base.CaseFormat; public class StackOverflow25680258 { public static void main(String[] args) { System.out.println(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, "input_in_snake_case")); } }
Output
InputInSnakeCase
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With