ltrim

@param string|null $charlist

@return  static
962161
public function trimLeft($charlist = null)
    {
        return $this->cloneInstance(
            function (StringObject $new) use ($charlist) {
                $new->string = Mbstring::ltrim($new->string, $charlist);
            }
        );
    }
853467
public function trim(string $charlist = " \t\n\r\0\x0B"): self
    {
        return self::make(trim($this->text, $charlist));
    }
1319062
public function words(string $charlist = ''): MapInterface
    {
        $words = \str_word_count($this->value, 2, $charlist);
        $map = new Map('int', self::class);

        foreach ($words as $position => $word) {
            $map = $map->put($position, new self($word, $this->encoding));
        }

        return $map;
    }
1235430
static function Trim($string, $chars = null)
    {
        self::InitEncoding();
        if (!$chars)
            return trim($string);

        return trim($string, $chars);
    }
591567
public function createList($list = null)
    {
        $node = new Item();

        if ($list instanceof Item) {
            $node = $list;
        } elseif ($list instanceof Element) {
            $node->entity->setEntityName($list->entity->getEntityName());

            if ($list instanceof Dropdown) {
                $list = clone $list;
                $node->attributes->addAttributeClass('dropdown');

                $list->toggle->tagName = 'a';
                $list->toggle->attributes->remove('type');
                $list->toggle->attributes->removeAttributeClass(['btn', 'btn-*']);
                $list->toggle->attributes->addAttribute('role', 'button');

                $node->childNodes->push($list->toggle);
                $node->childNodes->push($list->menu);
            } else {
                $node->childNodes->push($list);
            }

        } else {
            if (is_numeric($list)) {
                $node->entity->setEntityName('list-' . $list);
            } else {
                $node->entity->setEntityName($list);
            }
            $node->textContent->push($list);
        }

        $node->attributes->addAttributeClass('nav-item');
        $node->attributes->addAttribute('role', 'presentation');

        $this->pushChildNode($node);

        return $this->childNodes->last();
    }
881810
public function trim($regex = Strings::TRIM_CHARACTERS)
    {
        $this->_string = Strings::trim($this->_string, $regex);
        $this->_direction = null;

        return $this;
    }
1054189
public static function webalize(string $s, string $charList = null, bool $lower = true): string
    {
        $s = static::toAscii($s);
        if ($lower) {
            $s = \strtolower($s);
        }
        $s = \preg_replace('#[^a-z0-9' . ($charList !== null ? \preg_quote($charList, '#') : '') . ']+#i', '-', $s);
        $s = \trim($s, '-');

        return $s;
    }
642689
@NotNull
    public static List<String> toListWithEscaped(@Nullable final String stringList, @NotNull final String delimiter) {
        return new ArrayList<>(Arrays.asList(toArrayWithEscaped(stringList, delimiter)));
    }
1063819
public function _makeSmallData(&$raList)
    {
        $sRes = '';
        $FILE = $this->_FILEH_;
        $iSmBlk = 0;

        $iCount = count($raList);
        for ($i = 0; $i < $iCount; ++$i) {
            // Make SBD, small data string
            if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) {
                if ($raList[$i]->Size <= 0) {
                    continue;
                }
                if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) {
                    $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
                                  + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
                    // Add to SBD
                    $jB = $iSmbCnt - 1;
                    for ($j = 0; $j < $jB; ++$j) {
                        fwrite($FILE, pack("V", $j+$iSmBlk+1));
                    }
                    fwrite($FILE, pack("V", -2));

                    //// Add to Data String(this will be written for RootEntry)
                    //if ($raList[$i]->_PPS_FILE) {
                    //    fseek($raList[$i]->_PPS_FILE, 0); // To The Top
                    //    while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
                    //        $sRes .= $sBuff;
                    //    }
                    //} else {
                        $sRes .= $raList[$i]->_data;
                    //}
                    if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) {
                        $sRes .= str_repeat("\x00", $this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE));
                    }
                    // Set for PPS
                    $raList[$i]->_StartBlock = $iSmBlk;
                    $iSmBlk += $iSmbCnt;
                }
            }
        }
        $iSbCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE);
        if ($iSmBlk % $iSbCnt) {
            $iB = $iSbCnt - ($iSmBlk % $iSbCnt);
            for ($i = 0; $i < $iB; ++$i) {
                fwrite($FILE, pack("V", -1));
            }
        }
        return $sRes;
    }
684999
function _makeSmallData(&$raList)
    {
        $sRes = '';
        $FILE = $this->_FILEH_;
        $iSmBlk = 0;
   
        for ($i = 0; $i < count($raList); $i++) {
            // Make SBD, small data string
            if ($raList[$i]->Type == OLE_PPS_TYPE_FILE) {
                if ($raList[$i]->Size <= 0) {
                    continue;
                }
                if ($raList[$i]->Size < OLE_DATA_SIZE_SMALL) {
                    $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
                                  + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
                    // Add to SBD
                    for ($j = 0; $j < ($iSmbCnt-1); $j++) {
                        fwrite($FILE, pack("V", $j+$iSmBlk+1));
                    }
                    fwrite($FILE, pack("V", -2));
                   
                    // Add to Data String(this will be written for RootEntry)
                    if ($raList[$i]->_PPS_FILE) {
                        fseek($raList[$i]->_PPS_FILE, 0); // To The Top
                        while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
                            $sRes .= $sBuff;
                        }
                    } else {
                        $sRes .= $raList[$i]->_data;
                    }
                    if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) {
                        for ($j = 0; $j < ($this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)); $j++) {
                            $sRes .= "\x00";
                        }
                    }
                    // Set for PPS
                    $raList[$i]->_StartBlock = $iSmBlk;
                    $iSmBlk += $iSmbCnt;
                }
            }
        }
        $iSbCnt = floor($this->_BIG_BLOCK_SIZE / OLE_LONG_INT_SIZE);
        if ($iSmBlk % $iSbCnt) {
            for ($i = 0; $i < ($iSbCnt - ($iSmBlk % $iSbCnt)); $i++) {
                fwrite($FILE, pack("V", -1));
            }
        }
        return $sRes;
    }
814891
public static String lTrim(final String value) {
        if (value == null) {
            return null;
        }

        String trimmed = value;
        int offset = 0;
        final int maxLength = value.length();
        while (offset < maxLength && (value.charAt(offset) == ' ' || value.charAt(offset) == '\t')) {
            offset++;
        }

        if (offset > 0) {
            trimmed = value.substring(offset);
        }

        return trimmed;
    }
974549
public static function ol($list, $attributes = array())
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
496285
public function trim(array $chars = null){
		
		if($chars === null){
			return new static(\trim($this->_Value), $this->_Encoding);
		}
	
		$chars = \preg_quote(\implode(static::NONE, $chars));
		
		$str = \preg_replace(
				\sprintf('/(^[%s]+)|([%s]+$)/us', $chars, $chars),
				static::NONE,
				$this->_Value);
		
		return new static($str, $this->_Encoding);
			
	}
1009332
protected function _li($str) {
		// Initialize list parser
		$len=strlen($str);
		$ptr=0;
		$dst='';
		$first=TRUE;
		$tight=TRUE;
		$type='ul';
		// Main loop
		while ($ptr<$len) {
			if (preg_match('/^\h*[*-](?:\h?[*-]){2,}(?:\n+|$)/',
				substr($str,$ptr),$match)) {
				$ptr+=strlen($match[0]);
				// Embedded horizontal rule
				return (strlen($dst)?
					('<'.$type.'>'."\n".$dst.'</'.$type.'>'."\n\n"):'').
					'<hr />'."\n\n".$this->build(substr($str,$ptr));
			}
			elseif (preg_match('/(?<=^|\n)([*+-]|\d+\.)\h'.
				'(.+?(?:\n+|$))((?:(?: {4}|\t)+.+?(?:\n+|$))*)/s',
				substr($str,$ptr),$match)) {
				$match[3]=preg_replace('/(?<=^|\n)(?: {4}|\t)/','',$match[3]);
				$found=FALSE;
				foreach (array_slice($this->blocks,0,-1) as $regex)
					if (preg_match($regex,$match[3])) {
						$found=TRUE;
						break;
					}
				// List
				if ($first) {
					// First pass
					if (is_numeric($match[1]))
						$type='ol';
					if (preg_match('/\n{2,}$/',$match[2].
						($found?'':$match[3])))
						// Loose structure; Use paragraphs
						$tight=FALSE;
					$first=FALSE;
				}
				// Strip leading whitespaces
				$ptr+=strlen($match[0]);
				$tmp=$this->snip($match[2].$match[3]);
				if ($tight) {
					if ($found)
						$tmp=$match[2].$this->build($this->snip($match[3]));
				}
				else
					$tmp=$this->build($tmp);
				$dst.='<li>'.$this->scan(trim($tmp)).'</li>'."\n";
			}
		}
		return strlen($dst)?
			('<'.$type.'>'."\n".$dst.'</'.$type.'>'."\n\n"):'';
	}
167412
public function updateList(DataList &$list)
    {
        /** @var DataObject $singleton */
        $singleton = Injector::inst()->get($list->dataClass());
        $locale = $list->dataQuery()->getQueryParam('Fluent.Locale') ?: FluentState::singleton()->getLocale();
        if (!$singleton->hasExtension(FluentExtension::class)
            || !$singleton->hasField('SourceLocale')
            || !$locale
        ) {
            return;
        }

        $locale = FluentState::singleton()->getLocale();

        $query = $list->dataQuery();
        $query->having(['"SourceLocale" = ?' => $locale]);

        $list = $list->setDataQuery($query);
    }
1202022
public function rtrim(string $charlist = " \t\n\r\0\x0B"): self
    {
        return self::make(rtrim($this->text, $charlist));
    }
228920
public function stripTags($whiteList = '')
    {
        if (!$this->isString($whiteList)) {
            throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [
                '$whiteList',
                'integer'
            ]);
        }

        $this->val(strip_tags($this->val(), $whiteList));

        return $this;
    }