core :: Text :: to_camel_case
self
and converts it to camel caseassert "random_method_id".to_camel_case == "randomMethodId"
If the identifier is prefixed by an underscore, the underscore is ignored
assert "_private_field".to_camel_case == "_privateField"
If self
is upper, it is returned unchanged
assert "RANDOM_ID".to_camel_case == "RANDOM_ID"
If there are several consecutive underscores, they are considered as a single one
assert "random__method_id".to_camel_case == "randomMethodId"
# Takes a snake case `self` and converts it to camel case
#
# ~~~
# assert "random_method_id".to_camel_case == "randomMethodId"
# ~~~
#
# If the identifier is prefixed by an underscore, the underscore is ignored
#
# ~~~
# assert "_private_field".to_camel_case == "_privateField"
# ~~~
#
# If `self` is upper, it is returned unchanged
#
# ~~~
# assert "RANDOM_ID".to_camel_case == "RANDOM_ID"
# ~~~
#
# If there are several consecutive underscores, they are considered as a single one
#
# ~~~
# assert "random__method_id".to_camel_case == "randomMethodId"
# ~~~
fun to_camel_case: SELFTYPE is abstract
lib/core/text/abstract_text.nit:1351,2--1374,40
redef fun to_camel_case
do
var new_str = clone
new_str.camel_case
return new_str
end
lib/core/text/abstract_text.nit:1828,2--1833,4