FastPrepConvert Backticked Identifiers to Camel Case

Convert Backticked Identifiers to Camel Case

ZipRecruiter logoZipRecruiter● MediumNEW GRADOA
Learn

Problem statement

Delimiter code point 96 encloses space-separated lowercase snake_case identifiers or UPPER_CASE constants. Convert eligible lowercase identifiers inside delimiters to camelCase. Preserve uppercase constants and all outside text.

Function

convertBacktickedIdentifiers(docstring: String) → String

Examples

Example 1

docstring = "Use `foo_bar MAX_VALUE` now"return = "Use `fooBar MAX_VALUE` now"

Only eligible identifiers inside the delimited region change.

Example 2

docstring = "`one_two three` outside_name"return = "`oneTwo three` outside_name"

Only eligible identifiers inside the delimited region change.

Constraints

  • 0 <= docstring.length <= 100000
  • Delimiters are balanced.

More ZipRecruiter problems

See ZipRecruiter hiring insights
public String convertBacktickedIdentifiers(String docstring) {
    // Write your code here.
}
docstring"Use `foo_bar MAX_VALUE` now"
expected"Use `fooBar MAX_VALUE` now"
Checking account…