ika #6974(2008/08/04 04:24 GMT) [ D ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10
private import std.string, std.regexp; string totitle(in string str) { return str.sub(r"\b[a-z]", (RegExp m){return m[0].toupper();}, "g"); } unittest { assert("LL future".totitle() == "LL Future"); assert("LL day and night".totitle() == "LL Day And Night"); }
Rating0/0=0.00-0+
[ reply ]
ika
#6974()
[
D
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]