Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Unicode-strings/Ruby/unicode-strings-1.rb
Normal file
2
Task/Unicode-strings/Ruby/unicode-strings-1.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
str = "你好"
|
||||
str.include?("好") # => true
|
||||
5
Task/Unicode-strings/Ruby/unicode-strings-2.rb
Normal file
5
Task/Unicode-strings/Ruby/unicode-strings-2.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
def Σ(array)
|
||||
array.inject(:+)
|
||||
end
|
||||
|
||||
puts Σ([4,5,6]) #=>15
|
||||
4
Task/Unicode-strings/Ruby/unicode-strings-3.rb
Normal file
4
Task/Unicode-strings/Ruby/unicode-strings-3.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
p bad = "¿como\u0301 esta\u0301s?" # => "¿comó estás?"
|
||||
p bad.unicode_normalized? # => false
|
||||
p bad.unicode_normalize! # => "¿comó estás?"
|
||||
p bad.unicode_normalized? # => true
|
||||
Loading…
Add table
Add a link
Reference in a new issue