On Wednesday, 21 March 2018 at 12:07:49 UTC, Simen Kjærås wrote:
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote:
unittest {
assert("my capitalized string".capitalize == "myCapitalizedString");
}

auto capitalize(string s) {
    import std.regex, std.uni;

    return s.replaceAll!(a => a[1].toUpper)(regex(" (.)"));
}

Ty! This definitely put me on the right track regarding strings.

Reply via email to