original_string: public function slug($separator = '-')
      {
          $str = $this->toAscii();
  
          $flip = $separator == '-' ? '_' : '-';
          $str = str_replace('.', $separator, $str);
          $str = preg_replace('!['.preg_quote($flip).']+!u', $separator, $str);
          $str = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($str));
          $str = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $str);
  
          return trim($str, $separator);
      }
code: public function slug($separator = '-')
      {
          $str = $this->toAscii();
  
          $flip = $separator == '-' ? '_' : '-';
          $str = str_replace('.', $separator, $str);
          $str = preg_replace('!['.preg_quote($flip).']+!u', $separator, $str);
          $str = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($str));
          $str = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $str);
  
          return trim($str, $separator);
      }
code_tokens: public function slug ( $ separator = '-' ) { $ str = $ this -> toAscii ( ) ; $ flip = $ separator == '-' ? '_' : '-' ; $ str = str_replace ( '.' , $ separator , $ str ) ; $ str = preg_replace ( '![' . preg_quote ( $ flip ) . ']+!u' , $ separator , $ str ) ; $ str = preg_replace ( '![^' . preg_quote ( $ separator ) . '\pL\pN\s]+!u' , '' , mb_strtolower ( $ str ) ) ; $ str = preg_replace ( '![' . preg_quote ( $ separator ) . '\s]+!u' , $ separator , $ str ) ; return trim ( $ str , $ separator ) ; }
docstring: Generate a URL friendly "slug".
  
  @param string $separator
  
  @return string
docstring_tokens: Generate a URL friendly slug .