toDString

copy chars to string

  1. string toDString(const(char*) c_str)
    @trusted pure
    string
    toDString
    nothrow
    (
    const(char*) c_str
    )
  2. string toDStringFix(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