Skip to content

Latest commit

 

History

History
90 lines (66 loc) · 3.87 KB

File metadata and controls

90 lines (66 loc) · 3.87 KB

Available Chainable Methods:

StringableTrait.php

Available Methods

A-P P-T T-Z
after() padEnd() toMemeCase()
append() padStart() toPascalCase()
before() prepend() toSlug()
beforeLast() repeat() toSnakeCase()
between() replace() toSnakeCaseUC()
betweenLast() reverse() toTitleCase()
compress() stripAlpha() toUpperCase()
compressBetween() stripAlphaNumeric() trim()
compressEnd() stripNonNumeric() trimEnd()
compressStart() stripNumeric() trimFirstAndLastChar()
decodeHTML() stripSpecial() trimFirstAndLastWords()
decodeJson() stripSubstring() trimFirstChar()
encodeHTML() stripSubstringFromEnd() trimFirstWord()
encodeJson() stripSubstringFromStart() trimLastChar()
lcFirst() stripSubstrings() trimLastWord()
lcLast() stripWhitespace() trimStart()
lcNth() swap() trimSubstringFromEnd()
limit() toCamelCase() trimSubstringFromStart()
mask() toE161() trimSubstringFromStartAndEnd()
maskAfter() toKebabCase() ucFirst()
maskBefore() toKebabCaseUC() ucLast()
padBothEnds() toLowerCase() ucNth()

Returns the substring after the first occurrence of the provided substring.

$thread = Thread::make('abcdefg');
$thread->after('cd');
// "efg"

Appends the provided string to the end of the current string.

$thread = Thread::make('Good morning');
$thread->append(', America!');
// "Good morning, America!"

Returns the substring before the first occurrence of the provided substring.

$thread = Thread::make('abcdefg');
$thread->before('cd');
// "ab"

Returns the substring before the last occurrence of the provided substring.

$thread = Thread::make('aa bb cc dd cc bb aa');
$thread->beforeLast('cc');
// "aa bb cc dd "

$thread = Thread::make('the quick brown fox jumps over the lazy dog');
$thread->beforeLast('the');
// "the quick brown fox jumps over "

Returns the substring between the first occurrence of the provided start string and the first occurrence of the provided end string.

$thread = Thread::make('abcdefg');
$thread->between('b', 'f');
// "cde"