Thanks to visit codestin.com
Credit goes to github.com

Skip to content

In this library are implemented functions (Char.lower?, Char.digit?, etc) to work with Unicode characters, which are is missing in the stdlib.

License

Notifications You must be signed in to change notification settings

Chicker/unicode_char

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unicode.Char

In this library are implemented functions (Char.lower?, Char.digit?, etc) to work with Unicode characters, which are is missing in the stdlib.

Installation

Add unicode_char to your list of dependencies in mix.exs:

def deps do
  [{:unicode_char, "~> 0.6"}]
end

Implemented functions

  • lower?
  • upper?
  • digit?
  • control?
  • whitespace?
  • and so on.

Using

defmodule MyModule do
  alias Unicode.Char # for convenience
  
  if Char.upper?("È") do
    # do something with upper case letter
  else
    # otherwise
  end
end

Benchmarking

Function Time (ms) Comment
Char.digit? 533 4x faster
digit? regex 2_141
============== ======== ============
Char.upper? 599 3,6x faster
upper? regex 2_156
============== ========= ============
Char.lower? 603 3,6x faster
lower? regex 2_164

Steps to reproduce:

mix deps.get
mix bench --output ""

About

In this library are implemented functions (Char.lower?, Char.digit?, etc) to work with Unicode characters, which are is missing in the stdlib.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages