skip to main
|
skip to sidebar
學習 ruby 之路
2009年5月3日 星期日
loop syntax
syntax 1:
4.times {
puts "welcome to use ruby language"
}
syntax 2:
1.upto(5){
puts "nice to meet you"
}
10.downto(5){
puts "nice to meet you"
}
0.step(50,5){
puts "welcome to use ruby language"
}
1.upto(5) do |number|
puts number
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
檢視我的完整簡介
沒有留言:
張貼留言