Turn a string of format "foo_bar" into camelCase with the first letter in lower case: "fooBar"
Turn a string of format "foo_bar" into camelCase with the first letter in lower case: "fooBar"
This function is especially used to camelCase method names.
the String to camelCase
the camelCased string
(Since version 2019-03-02) Users are encouraged to use com.twitter.conversions.StringOps#toCamelCase
Camel case may start with a capital letter (called "Pascal Case" or "Upper Camel Case") or, especially often in programming languages, with a lowercase letter. In this code's perspective, PascalCase means the first char is capitalized while camelCase means the first char is lowercased. In general both can be considered equivalent although by definition "CamelCase" is a valid camel-cased word. Hence, PascalCase can be considered to be a subset of camelCase.
Turns a string of format "foo_bar" into PascalCase "FooBar"
Turns a string of format "foo_bar" into PascalCase "FooBar"
the String to PascalCase
the PascalCased string
(Since version 2019-03-02) Users are encouraged to use com.twitter.conversions.StringOps#toPascalCase
Camel case may start with a capital letter (called "Pascal Case" or "Upper Camel Case") or, especially often in programming languages, with a lowercase letter. In this code's perspective, PascalCase means the first char is capitalized while camelCase means the first char is lowercased. In general both can be considered equivalent although by definition "CamelCase" is a valid camel-cased word. Hence, PascalCase can be considered to be a subset of camelCase.
Turn a string of format "FooBar" into snake case "foo_bar"
Turn a string of format "FooBar" into snake case "foo_bar"
the underscored string
(Since version 2019-03-02) Users are encouraged to use com.twitter.conversions.StringOps#toSnakeCase
snakify is not reversible, ie. in general the following will _not_ be true:
s == camelify(snakify(s))