Skip to content

isaced/SwiftRubyStyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SwiftRubyStyle

Write Ruby style code in Swift.

puts

puts("hello") // hello

times

3.times {
    puts("hi")
}

// hi
// hi
// hi

// or
5.times { i in
    puts(i)
}

// 0
// 1
// 2
// 3
// 4

String

// count
["a"].count           // 1
["a","b"].size        // 2
["a","b","c"].length  // 3

// append
"hello " << "world"   // hello world

// *
"a " * 3              // a a a

Array

// Hello
// Swift
// Ruby

// *n
["a"] * 3             // a a a
["A", "B"] + ["C"]    // A B C

Dictionary

// each
_ = ["A": "Hello A", "B": "Hello B"].each { (k, v) in
    puts(k)
    puts(v)
}

About

Write Ruby style code in Swift.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages