diff --git a/README.md b/README.md index 800c892..ddb141b 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,24 @@ Support Package For Tamedevelopers * [getBetweenBoxLengthAndWeightInKg](#getBetweenBoxLengthAndWeightInKg) * [getBetweenBoxLengthAndWeightInCMB](#getBetweenBoxLengthAndWeightInCMB) * [Str](#str) - * [byteToUnit](#byteToUnit) - * [sizeToBytes](#sizeToBytes) + * [phone](#phone) + * [mask](#mask) + * [html](#html) + * [text](#text) + * [shorten](#shorten) + * [random](#random) + * [formatString](#formatString) + * [encrypt](#encrypt) + * [decrypt](#decrypt) + * [bindings](#bindings) + * [flattenValue](#flattenValue) + * [exceptArray](#exceptArray) + * [replaceFirst](#replaceFirst) + * [replaceLast](#replaceLast) + * [removeKeysFromArray](#removeKeysFromArray) + * [changeKeysFromArray](#changeKeysFromArray) + * [convertArrayKey](#convertArrayKey) + * [convertArrayCase](#convertArrayCase) * [Zip](#zip) * [Unzip](#unzip) * [Zip Download](#zip-download) @@ -167,7 +183,6 @@ Tame()->byteToUnit(6880); ``` ### unitToByte - ``` Tame()->unitToByte('24mb'); @@ -300,6 +315,14 @@ Tame()->formatNumberToNearestThousand(1500000); // Output: "1.5m" ``` +## Str +- The Core Class For String Manipulations + - It's helper class can be called, using -- `TameStr()` + +``` +Tamedevelopers\Support\Str +``` + ## Zip - Takes two param as `string` - [sourcePath] relative path of zip-file diff --git a/Str.php b/Str.php index 8b65e5e..c7b99a2 100644 --- a/Str.php +++ b/Str.php @@ -341,7 +341,9 @@ static public function replaceLast(string $search, string $replace, string $subj */ static public function formatString($string, $number = 4, $seperator = '-') { - return implode($seperator, str_split(self::trim($string), $number)); + $string = implode($seperator, str_split(self::trim($string), $number)); + + return self::replace(' ', '', $string); } /** diff --git a/Tests/str.php b/Tests/str.php index 33b68af..daa66e7 100644 --- a/Tests/str.php +++ b/Tests/str.php @@ -42,6 +42,8 @@ value: 'lower' ), + Str::formatString('5441298192889133', 3), + Str::snake('Peterso More'), Str::camel('peterson more'), Str::studly('peterson more'),