官术网_书友最值得收藏!

  • Mastering Elixir
  • André Albuquerque Daniel Caixinha
  • 59字
  • 2021-08-05 10:42:46

Ranges

Ranges, again, similar to what happens in Ruby, represent an interval between two integers. To create a range, we use this:

iex> 17..21
17..21
iex> 19 in 17..21
true

Similar to what we do with a list, we can use the in operator to check whether a number is between the start and the end of a range.

主站蜘蛛池模板: 通许县| 深圳市| 阜南县| 金华市| 乳山市| 呼玛县| 特克斯县| 扎囊县| 呈贡县| 武清区| 壤塘县| 高雄县| 永顺县| 庆城县| 舒城县| 巴楚县| 博兴县| 深水埗区| 鲁山县| 绥宁县| 晴隆县| 安平县| 台前县| 福贡县| 察哈| 张北县| 克东县| 屏南县| 上饶市| 鲜城| 黑山县| 建平县| 贺兰县| 河东区| 夹江县| 内江市| 阿拉善左旗| 桂平市| 卢氏县| 惠来县| 寿光市|