char_width
Version, currently 1.0.01 version
- 1.0.0latestMar 26, 2021
github.com/SamualLB/char_width
Width of Char and String for use in fixed-size terminals in Crystal
1 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
char_width:
github: SamualLB/char_width
version: ~> 1.0.0Then run:
shards installshard.yml
- Crystal
1.0.0- License
- MIT
- Author
- Samual Black
Dependencies
This version declares no dependencies.
README
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
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.0- Tagged
- Mar 26, 2021
- Commit
d6795280696d- Crystal
1.0.0- Indexed
- yes
Dependents
Repository
github.com/SamualLB/char_width
Metadata
- Created
- Aug 18, 2026
- Updated
- Sep 26, 2026
- Synced
- Sep 26, 2026
- Versions
- 1