Manual:DIL Manual/tolower()

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:04, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

tolower()

Function (string). Returns a string in lower case.

tolower(s : string)

Returns a copy of s with every capital letter made small: tolower("HELLO!") is "hello!". s itself is not changed.

Parameters

Name Type Meaning
s string The string.

Returns

String: s in lower case; "" for an empty string or one never set.

Notes

  • Only the letters A to Z change; letters outside ASCII stay as they are.
  • == on strings already ignores case. Use tolower() where case does
 matter: file names, getcmd(),
 replace(), < and >.

Example

dilbegin got_mail();
var
   ml : unitptr;
code
{
   ml := restore(tolower(self.name), null);

   if (ml != null)
   {
      act("<div class='mail'>You have a sudden urge to visit the post office.</div>",
          A_ALWAYS, self, null, null, TO_CHAR);
      destroy(ml);
   }

   quit;
}
dilend

From mail.zon: at login, checks whether mail was stored for the player under their name in lower case.

See also