original_string: private static function delimitString(string $string, string $delimiter): string
      {
          $output = [];
  
          if (preg_match('/\A[a-z0-9]+\z/ui', $string) && strtoupper($string) !== $string) {
              $parts = self::explodeOnCaps($string);
          } else {
              $parts = self::explodeOnDelims($string);
          }
  
          foreach ($parts as $part) {
              $output[] = $part.$delimiter;
          }
  
          return rtrim(implode('', $output), $delimiter);
      }
code: private static function delimitString(string $string, string $delimiter): string
      {
          $output = [];
  
          if (preg_match('/\A[a-z0-9]+\z/ui', $string) && strtoupper($string) !== $string) {
              $parts = self::explodeOnCaps($string);
          } else {
              $parts = self::explodeOnDelims($string);
          }
  
          foreach ($parts as $part) {
              $output[] = $part.$delimiter;
          }
  
          return rtrim(implode('', $output), $delimiter);
      }
code_tokens: private static function delimitString ( string $ string , string $ delimiter ) : string { $ output = [ ] ; if ( preg_match ( '/\A[a-z0-9]+\z/ui' , $ string ) && strtoupper ( $ string ) !== $ string ) { $ parts = self :: explodeOnCaps ( $ string ) ; } else { $ parts = self :: explodeOnDelims ( $ string ) ; } foreach ( $ parts as $ part ) { $ output [ ] = $ part . $ delimiter ; } return rtrim ( implode ( '' , $ output ) , $ delimiter ) ; }
docstring: Applies delimiter formatting to a string
  
  @param string $string    The original string
  @param string $delimiter The delimiter
  
  @return string
docstring_tokens: Applies delimiter formatting to a string