Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Find a substring within a stringReturn a string with just the ... (Berikutnya)
Functions for SCALARs or strings

Return lower-case version of a string

Daftar Isi

  • lc EXPR

  • lc

    Returns a lowercased version of EXPR. This is the internal functionimplementing the \L escape in double-quoted strings.

    If EXPR is omitted, uses $_.

    What gets returned depends on several factors:

    • If use bytes is in effect:
      • On EBCDIC platforms

        The results are what the C language system call tolower() returns.

      • On ASCII platforms

        The results follow ASCII semantics. Only characters A-Z change, to a-zrespectively.

    • Otherwise, if use locale (but not use locale ':not_characters') is in effect:

      Respects current LC_CTYPE locale for code points < 256; and uses Unicodesemantics for the remaining code points (this last can only happen ifthe UTF8 flag is also set). See perllocale.

      A deficiency in this is that case changes that cross the 255/256boundary are not well-defined. For example, the lower case of LATIN CAPITALLETTER SHARP S (U+1E9E) in Unicode semantics is U+00DF (on ASCIIplatforms). But under use locale, the lower case of U+1E9E isitself, because 0xDF may not be LATIN SMALL LETTER SHARP S in thecurrent locale, and Perl has no way of knowing if that character evenexists in the locale, much less what code point it is. Perl returnsthe input character unchanged, for all instances (and there aren'tmany) where the 255/256 boundary would otherwise be crossed.

    • Otherwise, If EXPR has the UTF8 flag set:

      Unicode semantics are used for the case change.

    • Otherwise, if use feature 'unicode_strings' or use locale ':not_characters') is in effect:

      Unicode semantics are used for the case change.

    • Otherwise:
      • On EBCDIC platforms

        The results are what the C language system call tolower() returns.

      • On ASCII platforms

        ASCII semantics are used for the case change. The lowercase of any characteroutside the ASCII range is the character itself.

 
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) Find a substring within a stringReturn a string with just the ... (Berikutnya)