← 返回 ramp 的题目列表Convert snake_case to camelCase while preserving edge underscores
类型:online_judge
ramp
Given a string connected by underscores (i.e., in snake_case), convert it to camelCase format but retain underscores at the beginning and end, if present.
Input
A string which may contain multiple words connected by underscores.
Output
A converted string with retained underscores at the beginning and end.
Example
- Input: "doc_string"
- Output: "docString"
- Input: "_the_variable"
- Output: "_theVariable"
- Input: "the_variable__"
- Output: "theVariable__"
Example
Input
doc_string