--- self[nth]

    nth ܤΥХȤ(ʸ)֤ޤ(դʸ
    ʸˤ Integer#chr [Integer/chr] Ȥޤ)
    nth ξʸޤ

    nth ϰϳؤ nil ֤ޤ

    :
        p 'bar'[2]        # => 114
        p 'bar'[2] == ?r  # => true
        p 'bar'[-1]       # => 114

        p 'bar'[3]        # => nil
        p 'bar'[-4]       # => nil

--- self[nth, len]

    nth ХܤĹ len ХȤʬʸ֤
    nth ξʸޤ

    nth ϰϳؤ nil ֤ޤ

--- self[substr]

    self  substr ޤ硢פʸ
    ֤ޤ
    substr ޤޤʤ nil ֤ޤ

        substr = "bar"
        result = "foobar"[substr]
        p result                  # => "bar"
        p substr.equal? result    # => true (ruby 1.7 feature:1.7.2 ʹߤ false)

--- self[regexp]
--- self[regexp, nth]   ruby 1.7 feature

    regexp ˥ޥåǽʬʸ֤ޤȤ߹ѿ 
    $~ ˥ޥå˴ؤꤵޤ

    regexp ˥ޥåʤ nil ֤ޤ

       p "foobar"[/bar/]  # => "bar"
       p $~.begin(0)      # => 3

    ruby 1.7 feature:
     nth ꤷϡregexp Ρnth ܤ
    ̤˥ޥåǽʬʸ֤ޤnth  0 ξ
    ϡޥåʬʸΤ֤ޤޥåʤä 
    nth б̤ʤ nil ֤ޤ

       p "foobar"[/bar/]   # => "bar"
       p $~.begin(0)       # => 3

       p "def getcnt(line)"[ /def\s*(\w+)/, 1 ]   # => "getcnt"

--- self[first..last]

    ǥå first  last ޤǤΥХȤޤ
    ʸ֤ޤ

        .
          0   1   2   3   4   5   (ǥå)
         -6  -5  -4  -3  -2  -1   (Υǥå)
        | a | b | c | d | e | f |
        |<--------->|                'abcdef'[0..2]  # => 'abc'
                        |<----->|    'abcdef'[4..5]  # => 'ef'
                |<--------->|        'abcdef'[2..4]  # => 'cde'

    last ʸĹʾΤȤ(ʸĹ - 1)
    ΤȤߤʤޤ

    first  0 꾮ʸĹ礭Ȥ
     first > last + 1 ǤȤ nil 
    ֤ޤ first  last Τɤ餫
    ޤξοΤȤϰ٤ʸĹ­
    ƻԤޤ

    :
        'abcd'[ 2 ..  1] # => ""
        'abcd'[ 2 ..  2] # => "c"
        'abcd'[ 2 ..  3] # => "cd"
        'abcd'[ 2 ..  4] # => "cd"

        'abcd'[ 2 .. -1] # => "cd"   # str[f..-1] ϡf ʸܤ
        'abcd'[ 2 .. -2] # => "c"    # ʸκǸޤǡפɽѶ

        'abcd'[ 1 ..  2] # => "bc"
        'abcd'[ 2 ..  2] # =>  "c"
        'abcd'[ 3 ..  2] # =>   ""
        'abcd'[ 4 ..  2] # =>  nil

        'abcd'[-3 ..  2] # =>  "bc"
        'abcd'[-4 ..  2] # => "abc"
        'abcd'[-5 ..  2] # =>  nil

--- self[first...last]

    ʸƬ 0 ܤη֡ self.length ܤη֤Ȥơ
    first ܤη֤ last ܤη֤ޤǤ˴ޤޤ
    Хޤʸ֤ޤ

        ʸȡַ֡פϼ

         0   1   2   3   4   5   6  (ֹ)
        -6  -5  -4  -3  -2  -1      (ηֹ)
         | a | b | c | d | e | f |
         |<--------->|                'abcdef'[0...3]  # => 'abc'
                         |<----->|    'abcdef'[4...6]  # => 'ef'
                 |<--------->|        'abcdef'[2...5]  # => 'cde'

    last ʸĹ礭ȤʸĹ
    ꤷΤȤߤʤޤ

    first  0 꾮ʸĹ礭Ȥ
     first > last ǤȤ nil ֤ޤ
     first  last Τɤ餫ޤξο
    ǤȤϰ٤ʸĹ­ƺƻԤޤ

    :
        'abcd'[ 2 ... 3] # => "c"
        'abcd'[ 2 ... 4] # => "cd"
        'abcd'[ 2 ... 5] # => "cd"

        'abcd'[ 1 ... 2] # => "b"
        'abcd'[ 2 ... 2] # => ""
        'abcd'[ 3 ... 2] # => nil

        'abcd'[-3 ... 2] # => "b"
        'abcd'[-4 ... 2] # => "ab"
        'abcd'[-5 ... 2] # => nil

