char_width v1.0.0
char_width
Check the width of a string. Should take into account combined characters and stuff.
Useful in console applications to stop weird formatting on some none-English characters.
Installation
- Add the dependency to your
shard.yml
:
dependencies:
char_width:
github: SamualLB/char_width
- Run
shards install
Usage
require "char_width"
Spec file is helpful, otherwise:
'a'.width # => 1
'\0'.width # => 0
'\r'.width # => -1
"abcde".width # => 5
"Tab\tSpace".width # => -1
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/SamualLB/char_width/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Samual Black - creator and maintainer
Repository
char_width
Owner
Statistic
- 1
- 0
- 0
- 1
- 0
- over 3 years ago
- February 3, 2020
License
MIT License
Links
Synced at
Thu, 21 Nov 2024 06:01:26 GMT
Languages