Skip to content

Commit 2bc5901

Browse files
committed
update README.md
1 parent 6f1c353 commit 2bc5901

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ You can install the package via composer:
2020
composer require dvlpr1996/php-string-helpers
2121
```
2222

23-
## StrUtility usage
23+
## StrUtility usage as static methods
2424

25-
String helper methods are static so usage like the following:
25+
you can use String helper methods as static so usage like the following:
2626
First Using The StrUtility Class:
2727

2828
```php
@@ -349,13 +349,47 @@ StrUtility::rmFirstWord(string $string): string
349349
```php
350350
StrUtility::is_slug(string $slug): bool
351351
```
352-
## PhpStringHelpers usage
352+
353+
- find whether the type of a given ip is valid ipv4
354+
355+
```php
356+
StrUtility::is_ipv4(string $ip): bool
357+
```
358+
359+
- find whether the type of a given ip is valid ipv6
360+
361+
```php
362+
StrUtility::is_ipv6(string $ip): bool
363+
```
364+
365+
- Deletes the words before the given $search word
366+
367+
```php
368+
StrUtility::after(string $string, string $search): string
369+
```
370+
371+
- Deletes the words after the given $search word
372+
373+
```php
374+
StrUtility::before(string $string, string $search): string
375+
```
376+
377+
## StrUtility usage as helper functions
353378

354379
String helper functions are global so usage like the following:
355380

356381
```php
357382
decrementBy(string $string, ?string $separator = null): string
358383
```
384+
## StrUtility usage as object
385+
386+
```php
387+
use PhpStringHelpers\utility\StrUtility;
388+
389+
$string = new StrUtility;
390+
391+
$string->toConstant('foo bar baz');
392+
```
359393

360394
## Changelog
361395

0 commit comments

Comments
 (0)