Magicode logo
Magicode
1 min read

文字列置換

https://cdn.apollon.ai/media/notebox/blob_AQeCEVd
文字列を1/2の確立で出し分けるスニペットです
ruby
#文字列置換
tempple = ["A","B"]
temp = "て{0}すと"
puts temp.gsub("{0}",tempple[rand(2)].chomp).encode("Shift_JIS")


i=2
p i
i+=3
p i
j=0
j+=i
p j
j+=i
p j

てBすと
2
5
5
10
10

Cervical spine is important

The other day, Team Y was at Trampoland and it looked like fun, so I looked for a nearby place to try trampolining and found just the right facility nearby. We went there at 10:00 a.m. today. I hadn't exercised in a long time and too strenuous a workout, and I hurt my cervical spine.

Discussion

コメントにはログインが必要です。