Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/stdlib/ext/string.rb

Instance Method Summary collapse

Instance Method Details

#get(index) ⇒ Object



8
9
10
# File 'lib/stdlib/ext/string.rb', line 8

def get(index)
    self.scan(/./)[index]
end

#ordinary(index) ⇒ Object



4
5
6
# File 'lib/stdlib/ext/string.rb', line 4

def ordinary (index)
    self.old_memeber index
end

#set(index, value) ⇒ Object



12
13
14
15
16
17
# File 'lib/stdlib/ext/string.rb', line 12

def set(index,value)
    arr = self.scan(/./)
    arr[index] = value
    self.replace(arr.join)
    value
end