MatchData#capturesが便利.
year, month = /(.+)-(.+)-.+/.match("2012-10-27").captures
この例だったらyear, month = *date.split('-')でもいいけど
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
MatchData#capturesが便利.
year, month = /(.+)-(.+)-.+/.match("2012-10-27").captures
この例だったらyear, month = *date.split('-')でもいいけど
Register as a new user and use Qiita more conveniently
Go to list of users who liked