original_string: protected function filter_by_letter($letter, $finalfield) {
          global $DB;
  
          $letter = core_text::strtoupper($letter);
          $len = core_text::strlen($letter);
          $sql = $DB->sql_substr(sprintf('upper(%s)', $finalfield), 1, $len);
  
          $this->where[] = "$sql = :letter";
          $this->params['letter'] = $letter;
      }
code: protected function filter_by_letter($letter, $finalfield) {
          global $DB;
  
          $letter = core_text::strtoupper($letter);
          $len = core_text::strlen($letter);
          $sql = $DB->sql_substr(sprintf('upper(%s)', $finalfield), 1, $len);
  
          $this->where[] = "$sql = :letter";
          $this->params['letter'] = $letter;
      }
code_tokens: protected function filter_by_letter ( $ letter , $ finalfield ) { global $ DB ; $ letter = core_text :: strtoupper ( $ letter ) ; $ len = core_text :: strlen ( $ letter ) ; $ sql = $ DB -> sql_substr ( sprintf ( 'upper(%s)' , $ finalfield ) , 1 , $ len ) ; $ this -> where [ ] = "$sql = :letter" ; $ this -> params [ 'letter' ] = $ letter ; }
docstring: Filter a field using a letter.
  
  @param string $letter     The letter.
  @param string $finalfield The SQL statement representing the field.
docstring_tokens: Filter a field using a letter .