Skip to content

Latest commit

 

History

History
62 lines (50 loc) · 1.3 KB

StringManager.md

File metadata and controls

62 lines (50 loc) · 1.3 KB

String Manager

public function washString(string $string): string

Replace special chars to regular ones

public function removeAccents($string): string

Remove accents from a string

public function removeLetters(string $input): string

Remove letters from a string

public function cleanString(string $input): string

Replace special chars to regular ones

public function deleteWordsFromString(string $input, array $wordsList): string

Delete an array of words from a string

public function stripLineBreaks(string $input): string

Remove all line breaks from a string

public function niceSubStr(string $input, int $length = 200): string

Does a substr without cutting a word in two

public function stringToLabel(string $input): string

Convert a string to a "labeled" version, like hello-you-foo

public function generateRandomString(int $length): string

Generates a random string

public function startsWith(string $haystack, string $needle): bool

Check if a string starts with another string

public function endsWith(string $haystack, string $needle): bool

Check if a string ends with another string

public function removeExtraSpaces(string $input): string

Remove extra spaces