Skip to content

tachiniererin/bananasplit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🍌split

Bananasplit is a simple library to split strings by Unicode code-point ranges.

Example

package main

import (
	"fmt"

	"github.com/tachiniererin/bananasplit"
)

func main() {
	// define only the emoji range, to split by emoji sequences
	// and everything else
	r := map[string][]bananasplit.RuneRange{
		"emoji": bananasplit.EmojiRange,
	}
	s := "tachiniererin🏳️‍🌈🏳️‍⚧️ emoji splitting"
	fmt.Printf("%+v", bananasplit.SplitByRanges(s, r))
}

About

Splitting Unicode strings by code-point ranges

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages