September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,2 +0,0 @@
|
|||
input a$
|
||||
print len(a$)
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
puts "あいうえお".length
|
||||
# => 5
|
||||
|
||||
puts "あいうえお".size # alias for length
|
||||
# => 5
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# -*- coding: iso-8859-1 -*-
|
||||
s = "møøse"
|
||||
puts "Byte length: %d" % s.bytesize
|
||||
puts "Character length: %d" % s.length
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
s = "møøse"
|
||||
puts "Byte length: %d" % s.bytesize
|
||||
puts "Character length: %d" % s.length
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
# -*- coding: gb18030 -*-
|
||||
s = "møøse"
|
||||
puts "Byte length: %d" % s.bytesize
|
||||
puts "Character length: %d" % s.length
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
class String
|
||||
# Define String#bytesize for Ruby 1.8.6.
|
||||
unless method_defined?(:bytesize)
|
||||
alias bytesize length
|
||||
end
|
||||
end
|
||||
|
||||
s = "文字化け"
|
||||
puts "Byte length: %d" % s.bytesize
|
||||
puts "Character length: %d" % s.gsub(/./u, ' ').size
|
||||
Loading…
Add table
Add a link
Reference in a new issue