def count_code(str)
puts (str.index("code") + 1)
end
count_code("aaacodebbb")
出力結果
4
Go to list of users who liked
More than 3 years have passed since last update.
def count_code(str)
puts (str.index("code") + 1)
end
count_code("aaacodebbb")
出力結果
4
Register as a new user and use Qiita more conveniently
Go to list of users who liked