What is the most elegant way to convert a hyphen separated word (e.g. "do-some-stuff") to the lower camel-case variation (e.g. "doSomeStuff") in Java?
Use CaseFormat from Guava:
CaseFormat
import static com.google.common.base.CaseFormat.*; String result = LOWER_HYPHEN.to(LOWER_CAMEL, "do-some-stuff");
2.1m questions
2.1m answers
60 comments
57.0k users