Skip to content

nitely/nim-unicodeplus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnicodePlus

Build Status licence

Common unicode operations.

Install

nimble install unicodeplus

Compatibility

Nim +1.0

Usage

import unicodeplus

assert "abc def ghi".isLower
assert "ABC DEF GHI".isUpper
assert "A Title - Yes!".isTitle
assert "  \L".isWhiteSpace
assert "abc123۲⅕".isAlnum
assert "abcd".isAlpha
assert "0123456789".isDecimal
assert "0123456789۲".isDigit
assert "0123456789۲⅕".isNumeric
assert "abcd".isPrintable
assert "The quick? (“brown”) fox can’t jump 32.3 feet, right?".toTitle ==
  "The Quick? (“Brown”) Fox Can’t Jump 32.3 Feet, Right?"
assert "The quick? (“brown”) fox can’t jump 32.3 feet, right?".toUpper ==
  "THE QUICK? (“BROWN”) FOX CAN’T JUMP 32.3 FEET, RIGHT?"
assert "The quIck? (“bRown”) fox cAn’T jUMp 32.3 feet, rIGHt?".toLower ==
  "the quick? (“brown”) fox can’t jump 32.3 feet, right?"
assert cmpCaseless("AbCσ", "aBcΣ")
assert toValidUtf8("a\xffb", replacement = "") == "ab"
assert verifyUtf8("a\xffb") == 1

docs

Tests

nimble test

LICENSE

MIT