Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
Ruby
Range 61 codes
Home
Ruby
Range
1 A for loop and an inclusive string range
2 A sub range
3 Add method to Range
4 An example of a for loop that prints out a times table (from 1 to 12) for the number 2
5 Being a lowercase letter
6 Check the range belongings
7 Convert range to array
8 Convert range to array or entries
9 Convert range to set
10 Create a multi-letter based range
11 DateTime Range
12 Drop the do It isnt required, but you have to keep end
13 Drop three elements in a range
14 Each and each_with_index loop with range
15 Each_cons loop with range
16 Each_slice loop with range
17 Extend Range to add new method
18 Find all odd elements
19 Get first two from a range
20 Get the max element in a range
21 Get the min and max with minmax
22 Get the min element in a range
23 Get three out of five
24 How many negative numbers
25 If you want to do the for loop on one line, you have to throw in the do
26 Inject a range
27 Is an integer in a range
28 Is an integer in an exclusive range
29 Iterating Over Dates
30 Minmax_by with block
31 Partition range
32 Prints 3 Flips and flops back when x==3
33 Prints 34 Flips when x == 3 and flops when x==4
34 Range based on DateTime
35 Range based on Time
36 Range calculation with Math log
37 Range class offers a simple way to convert a range into an array with to_a
38 Range containability check
39 Range pattern match
40 Reduce with operator
41 Reference to_a from a letter-based range
42 Reference to_a from a range
43 Reference to_a from a range in an excluded range
44 Reverse_each method from string
45 Select even elements
46 Test if something is included in the set of objects specified by the range
47 The for loop
48 The include Function can be used to check whether a particular number is within a range or not
49 The max Function gives the highest number in the range
50 The min Function gives the lowest number in the range
51 The range min and max methods return the first and last elements in an array
52 To create a range, use the operator For example, heres how you might create the range 1 to 4
53 Use Range new to create a range
54 Use the operator, which is the same thing except that the final item in the range is omitted
55 Uses several ranges to test values A range is a range of numbers
56 Variable based range
57 What are Ranges
58 When a range is used as an iterator, each value in the sequence is returned
59 With nested for loops, you can easily print out times tables from 1 to 12
60 With the Range class, you can also create a range
61 You have to create ranges in ascending sequence