Manual:DIL Manual/toupper()

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

toupper()

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

toupper(s : string)

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

Parameters

Name Type Meaning
s string The string.

Returns

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

Notes

  • Only the letters a to z change; letters outside ASCII stay as they are.
  • To capitalise only the first letter, combine it with left() and
 right() as in the example.

Example

dilbegin string capital(s : string);
code
{
   return(toupper(left(s, 1)) + right(s, length(s) - 1));
}
dilend

Returns the string with its first letter a capital, as helpzon.zon does with a help topic.

See also