Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/chinese-support.rb
Instance Method Summary collapse
- #中间(word, padding = ' ') ⇒ Object
- #代替(str) ⇒ Object
- #全小 ⇒ Object
- #全小! ⇒ Object
- #吃(seperator = $/) ⇒ Object
- #吃!(seperator = $/) ⇒ Object
- #大写 ⇒ Object
- #大写! ⇒ Object
- #拼音 ⇒ Object
- #放入(i, str) ⇒ Object
- #斩 ⇒ Object
- #斩! ⇒ Object
- #有?(str) ⇒ Object
- #检查 ⇒ Object
- #清理 ⇒ Object
- #空? ⇒ Object
- #第一 ⇒ Object
- #连接(obj) ⇒ Object
- #长度 ⇒ Object
Instance Method Details
#中间(word, padding = ' ') ⇒ Object
10 11 12 |
# File 'lib/chinese-support.rb', line 10 def 中间(word, padding=' ') self.center(word, padding) end |
#代替(str) ⇒ Object
62 63 64 |
# File 'lib/chinese-support.rb', line 62 def 代替(str) self.replace(str) end |
#全小 ⇒ Object
46 47 48 |
# File 'lib/chinese-support.rb', line 46 def 全小 self.downcase end |
#全小! ⇒ Object
50 51 52 |
# File 'lib/chinese-support.rb', line 50 def 全小! self.downcase! end |
#吃(seperator = $/) ⇒ Object
18 19 20 |
# File 'lib/chinese-support.rb', line 18 def 吃(seperator=$/) self.chomp(seperator) end |
#吃!(seperator = $/) ⇒ Object
22 23 24 |
# File 'lib/chinese-support.rb', line 22 def 吃!(seperator=$/) self.chomp!(seperator) end |
#大写 ⇒ Object
2 3 4 |
# File 'lib/chinese-support.rb', line 2 def 大写 self.capitalize end |
#大写! ⇒ Object
6 7 8 |
# File 'lib/chinese-support.rb', line 6 def 大写! self.capitalize! end |
#拼音 ⇒ Object
14 15 16 |
# File 'lib/chinese-support.rb', line 14 def 拼音 self.chars end |
#放入(i, str) ⇒ Object
66 67 68 |
# File 'lib/chinese-support.rb', line 66 def 放入(i, str) self.insert(i, str) end |
#斩 ⇒ Object
26 27 28 |
# File 'lib/chinese-support.rb', line 26 def 斩 self.chop end |
#斩! ⇒ Object
30 31 32 |
# File 'lib/chinese-support.rb', line 30 def 斩! self.chop! end |
#有?(str) ⇒ Object
58 59 60 |
# File 'lib/chinese-support.rb', line 58 def 有? str self.include? str end |
#检查 ⇒ Object
70 71 72 |
# File 'lib/chinese-support.rb', line 70 def 检查 self.inspect end |
#清理 ⇒ Object
38 39 40 |
# File 'lib/chinese-support.rb', line 38 def 清理 self.clear end |
#空? ⇒ Object
54 55 56 |
# File 'lib/chinese-support.rb', line 54 def 空? self.empty? end |
#第一 ⇒ Object
34 35 36 |
# File 'lib/chinese-support.rb', line 34 def 第一 self.chr end |
#连接(obj) ⇒ Object
42 43 44 |
# File 'lib/chinese-support.rb', line 42 def 连接(obj) self.concat(obj) end |
#长度 ⇒ Object
74 75 76 |
# File 'lib/chinese-support.rb', line 74 def 长度 self.length end |