{"title":" Enumerable#select \u3068 #collect \u3092\u540c\u6642\u306b\u884c\u3044\u305f\u3044","author_name":"kwatch","height":"190","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","width":"100%","categories":["ruby"],"published":"2010-03-30 22:47:14","description":"\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u5c0f\u30cd\u30bf\u3092\u3002Python \u3067\u306e\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u306f\u3001for \u3068 if \u3092\u540c\u6642\u306b\u66f8\u3051\u308b\u3002\u3053\u308c\u306f\u30eb\u30fc\u30d7\u30921\u56de\u307e\u308f\u308b\u3060\u3051\u3067\u3001\u9078\u629e (select) \u3068\u5199\u50cf (collect) \u3092\u4e00\u5ea6\u306b\u884c\u3048\u308b\u3053\u3068\u3092\u610f\u5473\u3059\u308b\u3002 >>> L = ['foo', 'bar', 'baz'] >>> [ x.upper() for x in L if x.startswith('ba') ] ['BAR', 'BAZ'] \u3053\u308c\u3068\u540c\u3058\u3053\u3068\u3092 Ruby \u3067\u3084\u308b\u3068\u3001Enumerable#collect \u3068 #select \u3092\u4f7f\u3046\u308f\u3051\u3060\u304c\u3001\u305d\u3046\u3059\u308b\u3068\u30eb\u30fc\u30d7\u30922\u56de\u307e\u308f\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u7684\u306b\u306f\u52d5\u4f5c\u52b9\u7387\u306f\u3088\u304f\u306a\u3044\u3002 irb\u2026","url":"https://kwatch.hatenadiary.org/entry/20100330/1269956834","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkwatch.hatenadiary.org%2Fentry%2F20100330%2F1269956834\" title=\" Enumerable#select \u3068 #collect \u3092\u540c\u6642\u306b\u884c\u3044\u305f\u3044 - k\u306a\u3093\u3068\u304b\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","version":"1.0","blog_title":"k\u306a\u3093\u3068\u304b\u306e\u65e5\u8a18","image_url":null,"blog_url":"https://kwatch.hatenadiary.org/","author_url":"https://blog.hatena.ne.jp/kwatch/","type":"rich"}