You are here

static function RTLMaker::insert_str in PersianTools 8

A simple function to insert a unicode char in a str.

2 calls to RTLMaker::insert_str()
RTLMaker::convert_sm in src/RTLMaker.php
Main function for multiple features and fixes of persiantools module.
RTLMaker::fix_mixed_path in src/RTLMaker.php
Fix mixed-up paths in rtl blocks. Logic: Gets triggered once a starting '.' or '/' is detected after a whitespace. The correcting symbol is inserted once an english char is seen inside the path.

File

src/RTLMaker.php, line 302
Contains \Drupal\persiantools\RTLMaker.

Class

RTLMaker

Namespace

Drupal\persiantools

Code

static function insert_str($str, $char, $pos) {
  return Unicode::substr($str, 0, $pos) . $char . Unicode::substr($str, $pos);
}