PageRenderTime 35ms CodeModel.GetById 21ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/test/string.rb

http://github.com/feyeleanor/RubyGoLightly
Ruby | 45 lines | 18 code | 10 blank | 17 comment | 0 complexity | 07b2ffa1b03ad4b2ac5366f9adedaba9 MD5 | raw file
 1puts "ohaie"
 2# => ohaie
 3
 4puts "ohaie".size
 5# => 5
 6
 7puts "ohaie".class.name
 8# => String
 9
10puts "oh" + "aie"
11# => ohaie
12
13puts "oh\naie"
14# => oh
15# => aie
16
17puts "\"oh\" \\ \\n"
18# => "oh" \ \n
19
20puts '\''
21# => '
22
23puts "
24hey
25"
26# => 
27# => hey
28# => 
29
30a = "xxx"
31a.replace "aaa"
32puts a
33# => aaa
34
35puts "a" <=> "b"
36# => -1
37puts "a" <=> "a"
38# => 0
39
40puts "ohaie".substring(0,2)
41# => oh
42puts "ohaie".substring(2,3)
43# => aie
44puts "ohaie".substring(2,4)
45# =>