Function snakeCaseToUpperCamelCase
Converts a string with underscore separator to upper camel case, for example converts "this_is_me" to "ThisIsMe"
string snakeCaseToUpperCamelCase
(
string original
);
Parameters
Name | Description |
---|---|
original | string that we want to convert to upper camel case |
Example
// base case
assert(snakeCaseToUpperCamelCase("this_is_me") == "ThisIsMe");
// extra underscore in the middle
assert(snakeCaseToUpperCamelCase("this__is_me") == "ThisIsMe");
// unnecessary underscores in the beginning and at the end
assert(snakeCaseToUpperCamelCase("_this_is_me_") == "ThisIsMe");
Example
import std .exception;
static bool willSucceed () { static int x; return ++x == 2; }
willSucceed() .retryFor(1 .seconds);
static bool willFail () { return false; }
assertThrown!AssertError(willFail() .retryFor(300 .msecs));