@param string|bool $custom_separator
@param bool $highlight

@return string
497161
public function get_serialized_values($custom_separator = false, $highlight = false)
    {
        if (0 === count($this->values)) {
            return null;
        }

        if ($this->is_multi()) {
            $separator = $custom_separator !== false ? $custom_separator : $this->databox_field->get_separator();

            return $this->serialize_value($this->values, $separator, $highlight);
        }

        /** @var caption_Field_Value $value */
        $value = current($this->values);

        if ($highlight) {
            return $value->highlight_thesaurus();
        }

        return $value->getValue();

    }
169849
public function addSeparator($token)
    {
        $cellContent = $this->wikiContentArr[$this->separatorCount];
        if ($cellContent === '') {
            if ($this->previousGenerator) {
                $this->previousGenerator->setColSpan($this->previousGenerator->getColSpan() + 1);
            }
        } else {
            if (preg_match('/^\s\s/', $cellContent) &&
                preg_match('/\s\s$/', $cellContent)) {
                if (trim($cellContent) != '') {
                    $this->generator->setAlign('center');
                }
            } elseif (preg_match('/^\s\s/', $cellContent)) {
                $this->generator->setAlign('right');
            } elseif (preg_match('/\s\s$/', $cellContent) && preg_match('/^\S/', $cellContent)) {
                $this->generator->setAlign('left');
            }
            $this->row->addGenerator($this->generator);
            $this->wikiContent .= $cellContent;
            $this->previousGenerator = $this->generator;
            $this->generator = $this->documentGenerator->getInlineGenerator($this->generatorName);
            if ($token == '^') {
                $this->generator->setIsHeader(true);
            }
            ++$this->separatorCount;
            $this->contents[$this->separatorCount] = '';
            $this->wikiContentArr[$this->separatorCount] = '';
        }
        $this->currentSeparator = $token;
        $this->wikiContent .= $token;
    }
1086055
public function getErrorsAsString(string $separator='<br />'): string
  {
    $errors = $this->errors;
    
    foreach($errors as &$error){
      $error = $error->getMessage();
    }
    
    return implode($separator, $errors);
  }
591448
private void showSeparators()
    {
        ListModel<Separator> ml = sepList.getModel();
        for (int i = 0; i < ml.getSize(); i++)
            drawSeparator(ml.getElementAt(i));
        browser.updateDisplay();
    }
    
    //========================================================================================
    
    private JPanel getSepListPanel()
    {
        if (sepListPanel == null)
        {
            GridLayout gridLayout3 = new GridLayout();
            gridLayout3.setRows(1);
            gridLayout3.setColumns(1);
            sepListPanel = new JPanel();
            sepListPanel.setLayout(gridLayout3);
            sepListPanel.add(getSepScroll(), null);
        }
        return sepListPanel;
    }

    private JScrollPane getSepScroll()
    {
        if (sepScroll == null)
        {
            sepScroll = new JScrollPane();
            sepScroll.setViewportView(getSepList());
        }
        return sepScroll;
    }

    private JList<Separator> getSepList()
    {
        if (sepList == null)
        {
            sepList = new JList<Separator>();
            sepList.addListSelectionListener(new javax.swing.event.ListSelectionListener()
            {
                public void valueChanged(javax.swing.event.ListSelectionEvent e)
                {
                    Separator sep = (Separator) sepList.getSelectedValue();
                    if (sep != null)
                    {
                        drawSeparator(sep);
                        browser.updateDisplay();
                    }
                }
            });
        }
        return sepList;
    }

    private JToolBar getShowToolBar()
    {
        if (showToolBar == null)
        {
            showToolBar = new JToolBar("Segmentation");
            showToolBar.add(getShowSepButton());
            showToolBar.add(getGridButton());
        }
        return showToolBar;
    }
    
    private JButton getShowSepButton()
    {
        if (showSepButton == null)
        {
            showSepButton = new JButton();
            showSepButton.setText("Separators");
            showSepButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    showSeparators();
                }
            });
        }
        return showSepButton;
    }

    /**
     * This method initializes gridButton   
     *  
     * @return javax.swing.JButton  
     */
    private JButton getGridButton()
    {
        if (gridButton == null)
        {
            gridButton = new JButton();
            gridButton.setText("Show grid");
            gridButton.addActionListener(new java.awt.event.ActionListener()
            {
                public void actionPerformed(java.awt.event.ActionEvent e)
                {
                    Area node = browser.getSelectedArea();
                    if (node != null)
                    {
                        node.getTopology().drawLayout(browser.getOutputDisplay());
                        browser.updateDisplay();
                    }
                }
            });
        }
        return gridButton;
    }


    
}
701261
public static function stringToClassName($str, $methodIncluded = true, $separator = ':')
	{
        $classParts = explode($separator, $str);

        $returnValue = new \stdClass();

		if($methodIncluded === true)
            $returnValue->methodName = array_pop($classParts);

        $returnValue->className = implode('\\', $classParts);

        return $returnValue;
    }
330190
public static function incrementSeparated(string $string, string $separator = '-'): string
    {
        if (preg_match('/' . $separator . '(\d+)$/', $string, $matches)) {
            $string = self::stripRight($string, $separator . $matches[1]);
            $duplicateNo = ((int) $matches[1]) + 1;
        } else {
            $duplicateNo = 2;
        }

        $newString = $string . $separator . $duplicateNo;

        return $newString;
    }
565118
public static function oxford_join($arr, string $separator = 'and') {
		if (! \is_array($arr) || ! \count($arr)) {
			return '';
		}

		$separator = \trim($separator);
		if (! $separator) {
			$separator = 'and';
		}
		$separator = " $separator ";

		// Let's build a nice array of joinable elements.
		$out = array();
		foreach ($arr as $v) {
			if ($v && (\is_string($v) || \is_numeric($v))) {
				$out[] = (string) $v;
			}
		}

		// Low counts don't require commas.
		if (\count($out) <= 2) {
			return \implode($separator, $out);
		}

		$last = (string) \array_pop($out);
		return \implode(', ', $out) . ",$separator" . $last;
	}
448196
public String join(String separator, final String keyValueSeparator) {
		return MapUtil.join(this.map, separator, keyValueSeparator);
	}
361329
public function addSeparator()
    {
        $e = new \FrenchFrogs\Form\Element\Separator();
        $e->setName('separator-' . rand(1111, 9999));
        $e->enableDiscreet();
        $this->addElement($e);
        return $e;
    }
952470
function (str, highlight) {
      highlight = highlight || false;
      var self = this;

      var highlightColor = this.highlightColor;
      var replace = function (str, pattern) {
        if (!highlight) {
          return str.replace(pattern, function (match) {
            self.currentMatch.matches.push(match);
            return self.replacementString;
          });
        }

        return str.replace(pattern, function (match) {
          self.currentMatch.matches.push(match);
          return '<span style="background: #' + highlightColor + ';">' + match + '</span>';
        });
      }.bind(this);

      if (typeof str !== 'string') {
        throw 'Invalid "str" type supplied in filterString. Expected string.';
      }

      for (var p in this.patterns) {
        if (!this.patterns[p].enabled) {
          continue;
        }

        if (this.patterns[p].pattern instanceof RegExp) {
          str = replace(str, this.patterns[p].pattern);

          continue;
        }

        if (!this.isArray(this.patterns[p].pattern)) {
          throw 'Invalid pattern type supplied. Expected Array.';
        }

        for (var i = 0; i < this.patterns[p].pattern.length; i++) {
          if (!this.patterns[p].pattern[i] instanceof RegExp) {
            throw 'Expected valid RegExp.';
          }

          str = replace(str, this.patterns[p].pattern[i]);
        }
      }

      return str;
    }
28803
public function toHTML($separator = '<br/>') {
        $output = '';

        foreach ($this->diff as $entry) {
            $element = '';
            if ($entry instanceof UnmodifiedEntry) {
                $element = 'span';
            } elseif ($entry instanceof DeletedEntry) {
                $element = 'del';
            } elseif ($entry instanceof InsertedEntry) {
                $element = 'ins';
            }
            $output .= '<' . $element . '>' . $entry . '</' . $element . '>' . $separator;
        }

        return $output;
    }
489460
public function getHref($index=null, $separator="/") {
		if (!isset($index)) {
			$index=sizeof($this->content);
		}
		if ($this->absolutePaths === true) {
			return $this->_hrefFunction($this->content[$index]);
		} else {
			return $this->root . implode($separator, array_slice(array_map(function ($e) {
				return $this->_hrefFunction($e);
			}, $this->content), $this->startIndex, $index + 1));
		}
	}
651008
private static function postProcessText($text, $separator)
    {
        if (function_exists('mb_strtolower')) {
            $text = mb_strtolower($text);
        } else {
            $text = strtolower($text);
        }

        // Remove all none word characters
        $text = preg_replace('/\W/', ' ', $text);

        // More stripping. Replace spaces with dashes
        $text = strtolower(preg_replace('/[^A-Za-z0-9\/]+/', $separator,
                           preg_replace('/([a-z\d])([A-Z])/', '\1_\2',
                           preg_replace('/([A-Z]+)([A-Z][a-z])/', '\1_\2',
                           preg_replace('/::/', '/', $text)))));

        return trim($text, $separator);
    }
1206802
protected static function highlightSingleField($fieldString, $highlightInfo, $arguments)
    {
        $result = null;

        foreach ($highlightInfo as $highlightItem) {
            $highlightItemStripped = str_replace(['\ueeee', '\ueeef'], ['', ''], $highlightItem);
            if (null !== strpos($fieldString, $highlightItemStripped)) {
                // HTML escape the text here if not explicitly configured to not do so.
                // Use f:format.raw in the template to avoid double escaping the HTML tags.
                if (!$arguments['raw']) {
                    $highlightItem = htmlspecialchars($highlightItem);
                }

                $highlightItemMarkedUp = str_replace(
                    ['\ueeee', '\ueeef'],
                    [$arguments['highlightTagOpen'], $arguments['highlightTagClose']],
                    $highlightItem);
                $result = str_replace($highlightItemStripped, $highlightItemMarkedUp, $fieldString);
                break;
            }
        }

        // If no highlighted string is present, use the original one.
        if (null === $result) {
            if ($arguments['raw']) {
                $result = $fieldString;
            } else {
                $result = htmlspecialchars($fieldString);
            }
        }

        return $result;
    }
899882
protected function buildRowSeparator(array $columnWidths, string $separator = '-'): string
	{
		$columns = count($columnWidths);

		return str_repeat($separator, array_sum($columnWidths) + (($columns * 4) - ($columns - 1))) . PHP_EOL;
	}
55189
public static function removeLast(string $string, string $separator): string
    {
        $string = explode($separator, $string);
        $string = Arr::removeLast($string);
        return implode($separator, $string);
    }
271425
public static function extensionSignature(string $namespace, string $extensionKey, string $separator = '.'): string {
    $namespace    = GeneralUtility::underscoredToUpperCamelCase($namespace);
    $extensionKey = GeneralUtility::underscoredToUpperCamelCase($extensionKey);

    return "${namespace}${separator}${extensionKey}";
  }