Crystal - Char - '💩'.pred => 💨, '💩'.succ => 💪

![char_unko.png](https://qiita-image-store.s3.amazonaws.com/0/43480/84eae953-e99a-aabc-7c4a-c0e9bfe24e0b.png)

Crystalの標準ライブラリのCharについて

## <i class="fa fa-diamond" style="font-size:1em;"></i> 概要
CrystalはRubyと異なり、StringとCharを明確に分けています。

### <i class="fa fa-cubes" style="font-size:1em;"></i> String
* <i class="fa fa-external-link" style="font-size:1em;"></i> [String - Crystal API Docs](http://crystal-lang.org/api/String.html)
* <i class="fa fa-external-link" style="font-size:1em;"></i> [String - Crystal Docs](http://crystal-lang.org/docs/syntax_and_semantics/literals/string.html)
* <i class="fa fa-external-link" style="font-size:1em;"></i> [string.cr - Crystal GitHub](https://github.com/manastech/crystal/blob/master/src/string.cr)

### <i class="fa fa-cube" style="font-size:1em;"></i> Char
* <i class="fa fa-external-link" style="font-size:1em;"></i> [Char - Crystal API Docs](http://crystal-lang.org/api/Char.html)
* <i class="fa fa-external-link" style="font-size:1em;"></i> [Char - Crystal Docs](http://crystal-lang.org/docs/syntax_and_semantics/literals/char.html)
* <i class="fa fa-external-link" style="font-size:1em;"></i> [char.cr - Crystal GitHub](https://github.com/manastech/crystal/blob/master/src/char.cr)

## <i class="fa fa-flask" style="font-size:1em;"></i> サンプル
### <i class="fa fa-code" style="font-size:1em;"></i> プログラム
```ruby
['a', 'z', 'A', 'Z', '0', '9','あ', '@', '{', '💩', '\f', ' ', '\n'].each do |e|
  puts "=== #{e} ==="
  pp e.alpha?
  pp e.alphanumeric?
  pp e.digit?
  pp e.control?
  pp e.whitespace?
  pp e.bytes
  pp e.upcase
  pp e.downcase
  pp e.pred
  pp e.succ
end
```

### <i class="fa fa-files-o" style="font-size:1em;"></i> 出力
```ruby
=== a ===
e.alpha? = true
e.alphanumeric? = true
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [97]
e.upcase = 'A'
e.downcase = 'a'
e.pred = '`'
e.succ = 'b'
=== z ===
e.alpha? = true
e.alphanumeric? = true
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [122]
e.upcase = 'Z'
e.downcase = 'z'
e.pred = 'y'
e.succ = '{'
=== A ===
e.alpha? = true
e.alphanumeric? = true
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [65]
e.upcase = 'A'
e.downcase = 'a'
e.pred = '@'
e.succ = 'B'
=== Z ===
e.alpha? = true
e.alphanumeric? = true
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [90]
e.upcase = 'Z'
e.downcase = 'z'
e.pred = 'Y'
e.succ = '['
=== 0 ===
e.alpha? = false
e.alphanumeric? = true
e.digit? = true
e.control? = false
e.whitespace? = false
e.bytes = [48]
e.upcase = '0'
e.downcase = '0'
e.pred = '/'
e.succ = '1'
=== 9 ===
e.alpha? = false
e.alphanumeric? = true
e.digit? = true
e.control? = false
e.whitespace? = false
e.bytes = [57]
e.upcase = '9'
e.downcase = '9'
e.pred = '8'
e.succ = ':'
=== あ ===
e.alpha? = false
e.alphanumeric? = false
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [227, 129, 130]
e.upcase = 'あ'
e.downcase = 'あ'
e.pred = 'ぁ'
e.succ = 'ぃ'
=== @ ===
e.alpha? = false
e.alphanumeric? = false
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [64]
e.upcase = '@'
e.downcase = '@'
e.pred = '?'
e.succ = 'A'
=== { ===
e.alpha? = false
e.alphanumeric? = false
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [123]
e.upcase = '{'
e.downcase = '{'
e.pred = 'z'
e.succ = '|'
=== 💩 ===
e.alpha? = false
e.alphanumeric? = false
e.digit? = false
e.control? = false
e.whitespace? = false
e.bytes = [240, 159, 146, 169]
e.upcase = '💩'
e.downcase = '💩'
e.pred = '💨'
e.succ = '💪'
===  ===
e.alpha? = false
e.alphanumeric? = false
e.digit? = false
e.control? = true
e.whitespace? = true
e.bytes = [12]
e.upcase = '\f'
e.downcase = '\f'
e.pred = '\v'
e.succ = '\r'
===   ===
e.alpha? = false
e.alphanumeric? = false
e.digit? = false
e.control? = false
e.whitespace? = true
e.bytes = [32]
e.upcase = ' '
e.downcase = ' '
e.pred = '\u{1f}'
e.succ = '!'
=== 
 ===
e.alpha? = false
e.alphanumeric? = false
e.digit? = false
e.control? = true
e.whitespace? = true
e.bytes = [10]
e.upcase = '\n'
e.downcase = '\n'
e.pred = '\t'
e.succ = '\v'
```

<i class="fa fa-external-link" style="font-size:1em;"></i> [Crystal Playground 実行結果](http://play.crystal-lang.org/#/r/fge)

## <i class="fa fa-github-square" style="font-size:1em;"></i> GitHub
CrystalのCharの実装が気になる方はこちら。

* <i class="fa fa-external-link" style="font-size:1em;"></i> [char.cr - Crystal GitHub](https://github.com/manastech/crystal/blob/master/src/char.cr)

## <i class="fa fa-book" style="font-size:1em;"></i> 外部資料
* <i class="fa fa-external-link" style="font-size:1em;"></i> [Char - Crystal API Docs](http://crystal-lang.org/api/Char.html)
* <i class="fa fa-external-link" style="font-size:1em;"></i> [Char - Crystal Docs](http://crystal-lang.org/docs/syntax_and_semantics/literals/char.html)
* <i class="fa fa-external-link" style="font-size:1em;"></i> [String - Crystal API Docs](http://crystal-lang.org/api/String.html)
* <i class="fa fa-external-link" style="font-size:1em;"></i> [String - Crystal Docs](http://crystal-lang.org/docs/syntax_and_semantics/literals/string.html)