toCamelCaseBySep

package pure @trusted
string
toCamelCaseBySep
(
in string str
,
string sep = "_"
,
bool first_capitalize = true
)

Examples

assertEq( toCamelCaseBySep( "single-precision-constant", "-", false ), "singlePrecisionConstant" );
assertEq( toCamelCaseBySep( "one.two.three", ".", true ), "OneTwoThree" );
assertEq( toCamelCaseBySep( "one..three", ".", true ), "OneThree" );
assertEq( toCamelCaseBySep( "one/three", "/" ), "OneThree" );
assertEq( toCamelCaseBySep( "one_.three", ".", false ), "one_Three" );

// `_` in upper case looks equals as lower case
assertEq( toCamelCaseBySep( "one._three", ".", true ), "One_three" );

Meta