{"action":"created","comment":{"url":"https://api.github.com/repos/manastech/crystal/pulls/comments/24306881","id":24306881,"diff_hunk":"@@ -160,6 +160,16 @@ class String\n     end\n   end\n \n+  def [](str : String)\n+    if start = index(str)\n+      self[start...start+str.size]\n+    end\n+  end\n+\n+  def []?(str : String)\n+    !!index(str)","path":"src/string.cr","position":11,"original_position":11,"commit_id":"1d977ef591b2571c1f481dc75a66aed4321676d8","original_commit_id":"1d977ef591b2571c1f481dc75a66aed4321676d8","user":{"login":"epitron","id":16409,"avatar_url":"https://avatars.githubusercontent.com/u/16409?v=3","gravatar_id":"","url":"https://api.github.com/users/epitron","html_url":"https://github.com/epitron","followers_url":"https://api.github.com/users/epitron/followers","following_url":"https://api.github.com/users/epitron/following{/other_user}","gists_url":"https://api.github.com/users/epitron/gists{/gist_id}","starred_url":"https://api.github.com/users/epitron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epitron/subscriptions","organizations_url":"https://api.github.com/users/epitron/orgs","repos_url":"https://api.github.com/users/epitron/repos","events_url":"https://api.github.com/users/epitron/events{/privacy}","received_events_url":"https://api.github.com/users/epitron/received_events","type":"User","site_admin":false},"body":"Hahah.. that's true. I wasn't thinking clearly. I'll fix. :)","created_at":"2015-02-09T02:48:08Z","updated_at":"2015-02-09T02:48:08Z","html_url":"https://github.com/manastech/crystal/pull/404#discussion_r24306881","pull_request_url":"https://api.github.com/repos/manastech/crystal/pulls/404","_links":{"self":{"href":"https://api.github.com/repos/manastech/crystal/pulls/comments/24306881"},"html":{"href":"https://github.com/manastech/crystal/pull/404#discussion_r24306881"},"pull_request":{"href":"https://api.github.com/repos/manastech/crystal/pulls/404"}}},"pull_request":{"url":"https://api.github.com/repos/manastech/crystal/pulls/404","id":28887725,"html_url":"https://github.com/manastech/crystal/pull/404","diff_url":"https://github.com/manastech/crystal/pull/404.diff","patch_url":"https://github.com/manastech/crystal/pull/404.patch","issue_url":"https://api.github.com/repos/manastech/crystal/issues/404","number":404,"state":"open","locked":false,"title":"'string[\"substring\"]' (like in Ruby) added","user":{"login":"epitron","id":16409,"avatar_url":"https://avatars.githubusercontent.com/u/16409?v=3","gravatar_id":"","url":"https://api.github.com/users/epitron","html_url":"https://github.com/epitron","followers_url":"https://api.github.com/users/epitron/followers","following_url":"https://api.github.com/users/epitron/following{/other_user}","gists_url":"https://api.github.com/users/epitron/gists{/gist_id}","starred_url":"https://api.github.com/users/epitron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epitron/subscriptions","organizations_url":"https://api.github.com/users/epitron/orgs","repos_url":"https://api.github.com/users/epitron/repos","events_url":"https://api.github.com/users/epitron/events{/privacy}","received_events_url":"https://api.github.com/users/epitron/received_events","type":"User","site_admin":false},"body":"A nice convenient way of checking the presence of a substring in a string.","created_at":"2015-02-08T22:09:55Z","updated_at":"2015-02-09T02:48:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62b784a8b4f8c2f1e343ccbed8f1c4dbcd76d21f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/manastech/crystal/pulls/404/commits","review_comments_url":"https://api.github.com/repos/manastech/crystal/pulls/404/comments","review_comment_url":"https://api.github.com/repos/manastech/crystal/pulls/comments/{number}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/404/comments","statuses_url":"https://api.github.com/repos/manastech/crystal/statuses/1d977ef591b2571c1f481dc75a66aed4321676d8","head":{"label":"epitron:strings","ref":"strings","sha":"1d977ef591b2571c1f481dc75a66aed4321676d8","user":{"login":"epitron","id":16409,"avatar_url":"https://avatars.githubusercontent.com/u/16409?v=3","gravatar_id":"","url":"https://api.github.com/users/epitron","html_url":"https://github.com/epitron","followers_url":"https://api.github.com/users/epitron/followers","following_url":"https://api.github.com/users/epitron/following{/other_user}","gists_url":"https://api.github.com/users/epitron/gists{/gist_id}","starred_url":"https://api.github.com/users/epitron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epitron/subscriptions","organizations_url":"https://api.github.com/users/epitron/orgs","repos_url":"https://api.github.com/users/epitron/repos","events_url":"https://api.github.com/users/epitron/events{/privacy}","received_events_url":"https://api.github.com/users/epitron/received_events","type":"User","site_admin":false},"repo":{"id":30103314,"name":"crystal","full_name":"epitron/crystal","owner":{"login":"epitron","id":16409,"avatar_url":"https://avatars.githubusercontent.com/u/16409?v=3","gravatar_id":"","url":"https://api.github.com/users/epitron","html_url":"https://github.com/epitron","followers_url":"https://api.github.com/users/epitron/followers","following_url":"https://api.github.com/users/epitron/following{/other_user}","gists_url":"https://api.github.com/users/epitron/gists{/gist_id}","starred_url":"https://api.github.com/users/epitron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epitron/subscriptions","organizations_url":"https://api.github.com/users/epitron/orgs","repos_url":"https://api.github.com/users/epitron/repos","events_url":"https://api.github.com/users/epitron/events{/privacy}","received_events_url":"https://api.github.com/users/epitron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/epitron/crystal","description":"The Crystal Programming Language","fork":true,"url":"https://api.github.com/repos/epitron/crystal","forks_url":"https://api.github.com/repos/epitron/crystal/forks","keys_url":"https://api.github.com/repos/epitron/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/epitron/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/epitron/crystal/teams","hooks_url":"https://api.github.com/repos/epitron/crystal/hooks","issue_events_url":"https://api.github.com/repos/epitron/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/epitron/crystal/events","assignees_url":"https://api.github.com/repos/epitron/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/epitron/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/epitron/crystal/tags","blobs_url":"https://api.github.com/repos/epitron/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/epitron/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/epitron/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/epitron/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/epitron/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/epitron/crystal/languages","stargazers_url":"https://api.github.com/repos/epitron/crystal/stargazers","contributors_url":"https://api.github.com/repos/epitron/crystal/contributors","subscribers_url":"https://api.github.com/repos/epitron/crystal/subscribers","subscription_url":"https://api.github.com/repos/epitron/crystal/subscription","commits_url":"https://api.github.com/repos/epitron/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/epitron/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/epitron/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/epitron/crystal/issues/comments/{number}","contents_url":"https://api.github.com/repos/epitron/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/epitron/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/epitron/crystal/merges","archive_url":"https://api.github.com/repos/epitron/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/epitron/crystal/downloads","issues_url":"https://api.github.com/repos/epitron/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/epitron/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/epitron/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/epitron/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/epitron/crystal/labels{/name}","releases_url":"https://api.github.com/repos/epitron/crystal/releases{/id}","created_at":"2015-01-31T05:26:16Z","updated_at":"2015-01-31T22:22:07Z","pushed_at":"2015-02-08T22:08:10Z","git_url":"git://github.com/epitron/crystal.git","ssh_url":"git@github.com:epitron/crystal.git","clone_url":"https://github.com/epitron/crystal.git","svn_url":"https://github.com/epitron/crystal","homepage":"http://crystal-lang.org","size":22141,"stargazers_count":0,"watchers_count":0,"language":"Crystal","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"manastech:master","ref":"master","sha":"bac37a6c022a4fa85b3c5f14185f38c8e34930d8","user":{"login":"manastech","id":1354950,"avatar_url":"https://avatars.githubusercontent.com/u/1354950?v=3","gravatar_id":"","url":"https://api.github.com/users/manastech","html_url":"https://github.com/manastech","followers_url":"https://api.github.com/users/manastech/followers","following_url":"https://api.github.com/users/manastech/following{/other_user}","gists_url":"https://api.github.com/users/manastech/gists{/gist_id}","starred_url":"https://api.github.com/users/manastech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manastech/subscriptions","organizations_url":"https://api.github.com/users/manastech/orgs","repos_url":"https://api.github.com/users/manastech/repos","events_url":"https://api.github.com/users/manastech/events{/privacy}","received_events_url":"https://api.github.com/users/manastech/received_events","type":"Organization","site_admin":false},"repo":{"id":6887813,"name":"crystal","full_name":"manastech/crystal","owner":{"login":"manastech","id":1354950,"avatar_url":"https://avatars.githubusercontent.com/u/1354950?v=3","gravatar_id":"","url":"https://api.github.com/users/manastech","html_url":"https://github.com/manastech","followers_url":"https://api.github.com/users/manastech/followers","following_url":"https://api.github.com/users/manastech/following{/other_user}","gists_url":"https://api.github.com/users/manastech/gists{/gist_id}","starred_url":"https://api.github.com/users/manastech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manastech/subscriptions","organizations_url":"https://api.github.com/users/manastech/orgs","repos_url":"https://api.github.com/users/manastech/repos","events_url":"https://api.github.com/users/manastech/events{/privacy}","received_events_url":"https://api.github.com/users/manastech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manastech/crystal","description":"The Crystal Programming Language","fork":false,"url":"https://api.github.com/repos/manastech/crystal","forks_url":"https://api.github.com/repos/manastech/crystal/forks","keys_url":"https://api.github.com/repos/manastech/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manastech/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manastech/crystal/teams","hooks_url":"https://api.github.com/repos/manastech/crystal/hooks","issue_events_url":"https://api.github.com/repos/manastech/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/manastech/crystal/events","assignees_url":"https://api.github.com/repos/manastech/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/manastech/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/manastech/crystal/tags","blobs_url":"https://api.github.com/repos/manastech/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manastech/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manastech/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/manastech/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manastech/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/manastech/crystal/languages","stargazers_url":"https://api.github.com/repos/manastech/crystal/stargazers","contributors_url":"https://api.github.com/repos/manastech/crystal/contributors","subscribers_url":"https://api.github.com/repos/manastech/crystal/subscribers","subscription_url":"https://api.github.com/repos/manastech/crystal/subscription","commits_url":"https://api.github.com/repos/manastech/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/manastech/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/manastech/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/manastech/crystal/issues/comments/{number}","contents_url":"https://api.github.com/repos/manastech/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/manastech/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manastech/crystal/merges","archive_url":"https://api.github.com/repos/manastech/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manastech/crystal/downloads","issues_url":"https://api.github.com/repos/manastech/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/manastech/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/manastech/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/manastech/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manastech/crystal/labels{/name}","releases_url":"https://api.github.com/repos/manastech/crystal/releases{/id}","created_at":"2012-11-27T17:32:32Z","updated_at":"2015-02-08T15:40:49Z","pushed_at":"2015-02-08T15:40:49Z","git_url":"git://github.com/manastech/crystal.git","ssh_url":"git@github.com:manastech/crystal.git","clone_url":"https://github.com/manastech/crystal.git","svn_url":"https://github.com/manastech/crystal","homepage":"http://crystal-lang.org","size":31345,"stargazers_count":1137,"watchers_count":1137,"language":"Crystal","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":63,"mirror_url":null,"open_issues_count":75,"forks":63,"open_issues":75,"watchers":1137,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/manastech/crystal/pulls/404"},"html":{"href":"https://github.com/manastech/crystal/pull/404"},"issue":{"href":"https://api.github.com/repos/manastech/crystal/issues/404"},"comments":{"href":"https://api.github.com/repos/manastech/crystal/issues/404/comments"},"review_comments":{"href":"https://api.github.com/repos/manastech/crystal/pulls/404/comments"},"review_comment":{"href":"https://api.github.com/repos/manastech/crystal/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/manastech/crystal/pulls/404/commits"},"statuses":{"href":"https://api.github.com/repos/manastech/crystal/statuses/1d977ef591b2571c1f481dc75a66aed4321676d8"}}}}