summaryrefslogtreecommitdiff
path: root/sample/split.rb
blob: 2b6f3921ce9a0c35b53fc19d63495ea822bf6f65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# split test
print("1 byte string", "\n")
print("1 byte string".reverse, "\n")

print("全角文字列", "\n")
print("全角文字列".reverse, "\n")

print("1 byte string", "\n")
print("1 byte string".split(//).reverse.join(":"), "\n")
print("全角文字列", "\n")
print("全角文字列".split(//).reverse.join(":"), "\n")
print("全角と1byteの混在", "\n")
print("全角と1byteの混在".split(//).reverse.join(":"), "\n")