toDStringFix

copy chars to string

  1. string toDString(const(char*) c_str)
  2. string toDStringFix(const(char[S]) c_buf)
    @trusted pure
    string
    toDStringFix
    nothrow
    (
    size_t S
    )
    (
    const(char[S]) c_buf
    )

Examples

1 assert( "someVar".toSnakeCase == "some_var" );
2 assert( "SomeVar".toSnakeCase == "some_var" );
3 assert( "SomeVar".toSnakeCase(false) == "_some_var" );
4 assert( "ARB".toSnakeCase == "a_r_b" );
5 assert( "ARB".toSnakeCase(false) == "_a_r_b" );
1 assert( "some_class".toCamelCase == "SomeClass" );
2 assert( "_some_class".toCamelCase == "SomeClass" );
3 assert( "some_func".toCamelCase(false) == "someFunc" );
4 assert( "_some_func".toCamelCase(false) == "someFunc" );
5 assert( "a_r_b".toCamelCase == "ARB" );
6 assert( toCamelCase( "program_build" ) == "ProgramBuild" );
7 assert( toCamelCaseBySep( "single-precision-constant", "-", false ) == "singlePrecisionConstant" );

Meta