-
-
Save mistyrinth/d7fc26f6124d29db8316164b0fdfc3b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 文字列の削除 | |
str1 = "Welcome" | |
puts "元の文字列は #{str1} です" | |
newStr1 = str1.delete("Wel") | |
puts "Wel を削除した後の文字列は #{newStr1} です" | |
# 文字列の分割 | |
str2 = "文章、文字、分割、テスト" | |
puts "元の文字列は「 #{str2} 」です" | |
newStr2 = str2.split("、") | |
puts "保存した配列は #{newStr2} となりました" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment