String to parse into lowercase.
Server case mapping; maps uppercase to lowercase characters.
The passed name string with uppercase characters replaced as per the case mappings.
IRCServer.CaseMapping m = IRCServer.CaseMapping.rfc1459; { immutable before = "ABCDEF"; immutable lowercase = toLowerCase(before, m); assert((lowercase == "abcdef"), lowercase); } { immutable before = "123"; immutable lowercase = toLowerCase(before, m); assert((lowercase == "123"), lowercase); assert(before is lowercase); assert(before.ptr == lowercase.ptr); } { immutable lowercase = toLowerCase("^[0v0]^", m); assert((lowercase == "~{0v0}~"), lowercase); } { immutable lowercase = toLowerCase(`A|\|`, m); assert((lowercase == "a|||"), lowercase); } m = IRCServer.caseMapping.ascii; { immutable before = "^[0v0]^"; immutable lowercase = toLowerCase(before, m); assert((lowercase == "^[0v0]^"), lowercase); assert(before is lowercase); assert(before.ptr == lowercase.ptr); } { immutable lowercase = toLowerCase(`A|\|`, m); assert((lowercase == `a|\|`), lowercase); } m = IRCServer.CaseMapping.strict_rfc1459; { immutable lowercase = toLowerCase("^[0v0]^", m); assert((lowercase == "^{0v0}^"), lowercase); }
Produces the passed string in lowercase as per the supplied case mappings.
This function is @trusted to be able to cast the internal output char array to string. Appender does this with its data/opSlice methods.
So just do the same.