From 995f55a010f9d32487a974032e07e29914fe5ddd Mon Sep 17 00:00:00 2001 From: clipperhouse Date: Wed, 14 Aug 2024 14:27:06 -0400 Subject: [PATCH] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0f87d7a..47b1031 100644 --- a/README.md +++ b/README.md @@ -50,19 +50,21 @@ Standard library: This package does two things to achieve zero allocations. First, it lazily iterates over the splits, instead of collecting them into an array. -Second, each split is a `Span`, which is a "view" into the underlying `string` or `byte[]`, and stays on the stack. +Second, each split is a `Span`, which is a "view" into the underlying `string` or `byte[]`, and stays on the stack. [Here's a blog post](https://clipperhouse.com/split/). ### Data types -`using Split;` +**`using Split.Extensions;`** -You'll find `Split.Bytes()`, which can accept `byte[]`, `(ReadOnly)Span` and `Stream`. If you want to split on a multi-byte rune (Unicode codepoint), you'll need to get its encoding first, using something like `Encoding.UTF8.GetBytes()`. +You will find `.SplitOn()` and `.SplitOnAny()` extension methods added to: `string`, `byte[]`, `char[]`, `(ReadOnly)Span`, `Stream` and `TextReader`/`StreamReader` . -You'll find `Split.Chars()`, which can accept `string`, `char[]`, `(ReadOnly)Span` and `TextReader`/`StreamReader`. +**`using Split;`** -`using Split.Extensions;` +If you don't like all those extension methods hanging off your types: -Each of the above types will have `.SplitOn()` methods. I chose that so as not to conflict with `.Split()`. +You'll find `Split.Bytes()` and `Split.BytesAny()`, accepting `byte[]`, `(ReadOnly)Span` and `Stream`. + +You'll find `Split.Chars()` and `Split.CharsAny()`, which can accept `string`, `char[]`, `(ReadOnly)Span` and `TextReader`/`StreamReader`. ### Testing