Cari di Perl 
    Perl User Manual
Daftar Isi
(Sebelumnya) Functions __FILE__Functions for (Berikutnya)
Perl Functions A-Z

Functions fc

Daftar Isi

  • fc EXPR

  • fc

    Returns the casefolded version of EXPR. This is the internal functionimplementing the \F escape in double-quoted strings.

    Casefolding is the process of mapping strings to a form where casedifferences are erased; comparing two strings in their casefoldedform is effectively a way of asking if two strings are equal,regardless of case.

    Roughly, if you ever found yourself writing this

    1. lc($this) eq lc($that) # Wrong!
    2. # or
    3. uc($this) eq uc($that) # Also wrong!
    4. # or
    5. $this =~ /\Q$that/i # Right!

    Now you can write

    1. fc($this) eq fc($that)

    And get the correct results.

    Perl only implements the full form of casefolding.For further information on casefolding, refer tothe Unicode Standard, specifically sections 3.13 Default Case Operations,4.2 Case-Normative, and 5.18 Case Mappings,available at http://www.unicode.org/versions/latest/, as well as theCase Charts available at http://www.unicode.org/charts/case/.

    If EXPR is omitted, uses $_.

    This function behaves the same way under various pragma, such as in a locale,as lc does.

    While the Unicode Standard defines two additional forms of casefolding,one for Turkic languages and one that never maps one character into multiplecharacters, these are not provided by the Perl core; However, the CPAN moduleUnicode::Casing may be used to provide an implementation.

    This keyword is available only when the "fc" feature is enabled,or when prefixed with CORE::; See feature. Alternately,include a use v5.16 or later to the current scope.

 
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) Functions __FILE__Functions for (Berikutnya)