summaryrefslogtreecommitdiff
path: root/sample/split.rb
blob: 737173635e294eed12626b334384d2b8f422aefd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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")