{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/Common/pulls/comments/49200377","id":49200377,"diff_hunk":"@@ -0,0 +1,101 @@\n+﻿// Copyright (c) .NET Foundation. All rights reserved.\n+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n+\n+using System;\n+using System.Collections;\n+using System.Collections.Generic;\n+\n+namespace Microsoft.Extensions.Primitives\n+{\n+    /// <summary>\n+    /// Tokenizes a <c>string</c> into <see cref=\"StringSegment\"/>s.\n+    /// </summary>\n+    public struct StringTokenizer :  IEnumerable<StringSegment>\n+    {\n+        private readonly string _value;\n+        private readonly char _separator;\n+\n+        /// <summary>\n+        /// Initializes a new instance of <see cref=\"StringTokenizer\"/>.\n+        /// </summary>\n+        /// <param name=\"value\">The <c>string</c> to tokenize.</param>\n+        /// <param name=\"separator\">The character to tokenize by.</param>\n+        public StringTokenizer(string value, char separator)\n+        {\n+            if (value == null)\n+            {\n+                throw new ArgumentNullException(nameof(value));\n+            }\n+\n+            _value = value;\n+            _separator = separator;\n+        }\n+\n+        /// <inheritdoc />\n+        public IEnumerator<StringSegment> GetEnumerator()\n+        {\n+            return new Enumerator(ref this);\n+        }\n+\n+        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();\n+\n+        public struct Enumerator : IEnumerator<StringSegment>\n+        {\n+            private readonly string _value;\n+            private readonly char _separator;\n+            private int _index;\n+\n+            public Enumerator(ref StringTokenizer tokenizer)\n+            {\n+                _value = tokenizer._value;\n+                _separator = tokenizer._separator;\n+                Current = default(StringSegment);\n+                _index = 0;\n+            }\n+\n+            public StringSegment Current { get; private set; }\n+\n+            object IEnumerator.Current => Current;\n+\n+            public void Dispose()\n+            {\n+            }\n+\n+            public bool MoveNext()\n+            {\n+                if (_index > _value.Length)\n+                {\n+                    return false;\n+                }\n+\n+                var next = _value.IndexOf(_separator, _index);\n+                if (next == -1)\n+                {\n+                    if (_index <= _value.Length)","path":"src/Microsoft.Extensions.Primitives/StringTokenizer.cs","position":74,"original_position":74,"commit_id":"0cdfd5abfc85103d856ba7abfcf7cb6e2bb1bcf9","original_commit_id":"0cdfd5abfc85103d856ba7abfcf7cb6e2bb1bcf9","user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2016-01-08T15:39:12Z","updated_at":"2016-01-08T15:39:12Z","html_url":"https://github.com/aspnet/Common/pull/81#discussion_r49200377","pull_request_url":"https://api.github.com/repos/aspnet/Common/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/aspnet/Common/pulls/comments/49200377"},"html":{"href":"https://github.com/aspnet/Common/pull/81#discussion_r49200377"},"pull_request":{"href":"https://api.github.com/repos/aspnet/Common/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/Common/pulls/81","id":55416352,"html_url":"https://github.com/aspnet/Common/pull/81","diff_url":"https://github.com/aspnet/Common/pull/81.diff","patch_url":"https://github.com/aspnet/Common/pull/81.patch","issue_url":"https://api.github.com/repos/aspnet/Common/issues/81","number":81,"state":"open","locked":false,"title":"Add StringTokenizer and StringSegment.Split","user":{"login":"pranavkm","id":174281,"avatar_url":"https://avatars.githubusercontent.com/u/174281?v=3","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-08T01:58:17Z","updated_at":"2016-01-08T15:39:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0cef13ac6e238f69f332470160c665aa55ac104","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/Common/pulls/81/commits","review_comments_url":"https://api.github.com/repos/aspnet/Common/pulls/81/comments","review_comment_url":"https://api.github.com/repos/aspnet/Common/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/Common/issues/81/comments","statuses_url":"https://api.github.com/repos/aspnet/Common/statuses/0cdfd5abfc85103d856ba7abfcf7cb6e2bb1bcf9","head":{"label":"aspnet:prkrishn/string-tokenizer","ref":"prkrishn/string-tokenizer","sha":"0cdfd5abfc85103d856ba7abfcf7cb6e2bb1bcf9","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30932325,"name":"Common","full_name":"aspnet/Common","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Common","description":"A repository for shared files to be consumed across the ASPNET repos","fork":false,"url":"https://api.github.com/repos/aspnet/Common","forks_url":"https://api.github.com/repos/aspnet/Common/forks","keys_url":"https://api.github.com/repos/aspnet/Common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Common/teams","hooks_url":"https://api.github.com/repos/aspnet/Common/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Common/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Common/events","assignees_url":"https://api.github.com/repos/aspnet/Common/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Common/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Common/tags","blobs_url":"https://api.github.com/repos/aspnet/Common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Common/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Common/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Common/languages","stargazers_url":"https://api.github.com/repos/aspnet/Common/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Common/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Common/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Common/subscription","commits_url":"https://api.github.com/repos/aspnet/Common/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Common/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Common/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Common/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Common/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Common/merges","archive_url":"https://api.github.com/repos/aspnet/Common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Common/downloads","issues_url":"https://api.github.com/repos/aspnet/Common/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Common/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Common/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Common/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Common/releases{/id}","created_at":"2015-02-17T19:02:08Z","updated_at":"2016-01-02T15:08:50Z","pushed_at":"2016-01-08T01:58:17Z","git_url":"git://github.com/aspnet/Common.git","ssh_url":"git@github.com:aspnet/Common.git","clone_url":"https://github.com/aspnet/Common.git","svn_url":"https://github.com/aspnet/Common","homepage":null,"size":401,"stargazers_count":17,"watchers_count":17,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":7,"forks":11,"open_issues":7,"watchers":17,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"f6274bb9afb8f30e7bc0cc17d99b8361b220a827","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30932325,"name":"Common","full_name":"aspnet/Common","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/Common","description":"A repository for shared files to be consumed across the ASPNET repos","fork":false,"url":"https://api.github.com/repos/aspnet/Common","forks_url":"https://api.github.com/repos/aspnet/Common/forks","keys_url":"https://api.github.com/repos/aspnet/Common/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/Common/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/Common/teams","hooks_url":"https://api.github.com/repos/aspnet/Common/hooks","issue_events_url":"https://api.github.com/repos/aspnet/Common/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/Common/events","assignees_url":"https://api.github.com/repos/aspnet/Common/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/Common/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/Common/tags","blobs_url":"https://api.github.com/repos/aspnet/Common/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/Common/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/Common/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/Common/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/Common/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/Common/languages","stargazers_url":"https://api.github.com/repos/aspnet/Common/stargazers","contributors_url":"https://api.github.com/repos/aspnet/Common/contributors","subscribers_url":"https://api.github.com/repos/aspnet/Common/subscribers","subscription_url":"https://api.github.com/repos/aspnet/Common/subscription","commits_url":"https://api.github.com/repos/aspnet/Common/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/Common/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/Common/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/Common/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/Common/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/Common/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/Common/merges","archive_url":"https://api.github.com/repos/aspnet/Common/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/Common/downloads","issues_url":"https://api.github.com/repos/aspnet/Common/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/Common/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/Common/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/Common/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/Common/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/Common/releases{/id}","created_at":"2015-02-17T19:02:08Z","updated_at":"2016-01-02T15:08:50Z","pushed_at":"2016-01-08T01:58:17Z","git_url":"git://github.com/aspnet/Common.git","ssh_url":"git@github.com:aspnet/Common.git","clone_url":"https://github.com/aspnet/Common.git","svn_url":"https://github.com/aspnet/Common","homepage":null,"size":401,"stargazers_count":17,"watchers_count":17,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":7,"forks":11,"open_issues":7,"watchers":17,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/Common/pulls/81"},"html":{"href":"https://github.com/aspnet/Common/pull/81"},"issue":{"href":"https://api.github.com/repos/aspnet/Common/issues/81"},"comments":{"href":"https://api.github.com/repos/aspnet/Common/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/Common/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/Common/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/Common/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/Common/statuses/0cdfd5abfc85103d856ba7abfcf7cb6e2bb1bcf9"}}}}