skip to main
|
skip to sidebar
學習 ruby 之路
2009年5月3日 星期日
iteration string
string1="this is a ruby"
string1.scan(/./) {|letter| puts letter}
string1.scan(/../) {|letter| puts letter}
string2="there are $1000 dollers here 10 days"
string2.scan(/\d+/) do |x|
puts x
end
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
追蹤者
網誌存檔
▼
2009
(12)
▼
5月
(12)
define a array
iteration string
string substitution
interpolation string
character char and value
mutli line in ruby string
loop syntax
if-else syntax
class string method
define a function
define a class inherit another class
Define a class
關於我自己
Unknown
檢視我的完整簡介
沒有留言:
張貼留言