Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
navarr authored Apr 29, 2024
1 parent 87f01d2 commit 1356cc9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Fast, Appropriate String Manipulation

SmartString is a library that automatically determines whether a string of text can use PHP's byte manipulation tools, or if it needs to be upgraded to use Grapheme manipulations - allowing you to process text as quickly and as accurately as possible.

## Installation

composer require navarr/smartstring

## Usage

```php
use Navarr\SmartString\SmartStringFactory;
use Navarr\SmartString\SmartString;

// Factory Methodology
$factory = new SmartStringFactory();
$example = $factory->create('🏴󠁧󠁢󠁥󠁮󠁧󠁿');
echo $example->strlen(); // 1

// Singleton Methodology
$example = SmartString::build('Test');
echo $example->strlen(); // 4
```

0 comments on commit 1356cc9

Please sign in to comment.