Help for this page

Select Code to Download


  1. or download this
    $string =~ /^(.)/;
    $first_char = $1;
    
  2. or download this
    @chars = split //, $string;
    $first_char = @chars[0];
    
  3. or download this
    $first_char = unpack 'a', $string;