{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/1244","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/1244/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/1244/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/1244/events","html_url":"https://github.com/dotnet/corefx/issues/1244","id":64331705,"number":1244,"title":"Add overloads to string trimming","user":{"login":"ChrisEelmaa","id":4801003,"avatar_url":"https://avatars.githubusercontent.com/u/4801003?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisEelmaa","html_url":"https://github.com/ChrisEelmaa","followers_url":"https://api.github.com/users/ChrisEelmaa/followers","following_url":"https://api.github.com/users/ChrisEelmaa/following{/other_user}","gists_url":"https://api.github.com/users/ChrisEelmaa/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisEelmaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisEelmaa/subscriptions","organizations_url":"https://api.github.com/users/ChrisEelmaa/orgs","repos_url":"https://api.github.com/users/ChrisEelmaa/repos","events_url":"https://api.github.com/users/ChrisEelmaa/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisEelmaa/received_events","type":"User","site_admin":false},"labels":[{"id":153714228,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-needs-work","name":"api-needs-work","color":"207de5","default":false},{"id":174276033,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Runtime","name":"area-System.Runtime","color":"d4c5f9","default":false},{"id":145399958,"url":"https://api.github.com/repos/dotnet/corefx/labels/up%20for%20grabs","name":"up for grabs","color":"159818","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestone/5","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"number":5,"title":"Future","description":"Milestone tracking the issues triaged for an unspecified future release","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":724,"closed_issues":6,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2016-12-26T23:22:11Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-03-25T17:47:54Z","updated_at":"2016-12-27T18:42:32Z","closed_at":null,"body":"The proposal is to add new extension methods / overloads for string trimming,\n\nAs you know, right now, it's only possible to trim individual characters from a string, but I would like to trim suffixes & prefixes.\n\nAn example usage:\n\n`\"MyTest\".TrimEnd(\"Test\") == \"My\" == true`\n\nI feel like they should've be there. It seems kind of weird to me, as I've implemented these by myself in the past few times, and am sure there are quite few people who miss this & would find it useful:\n\nhttp://stackoverflow.com/questions/7170909/trim-string-from-end-of-string-in-net-why-is-this-missing\nhttp://stackoverflow.com/questions/4101539/c-sharp-removing-strings-from-end-of-string\nhttp://stackoverflow.com/questions/5284591/how-to-remove-a-suffix-from-end-of-string\nhttp://stackoverflow.com/questions/4335878/c-sharp-trimstart-with-string-parameter\n\nNow the following statement is not true, but if it would be, it would describe how I am feeling: \"ooh hey, we offer you string replace method which can replace individual chars, but not the whole strings. It's not too hard to craft your own one, give it a try!\"\n\nThe following applies to `TrimEnd` / `TrimStart`, but the overloads would be 1:1, so I will discuss only `TrimEnd`.\n\n**First overload:**\n\n`public string TrimEnd(string suffix)`\n\nBehaviour: trim the suffix, case-sensitive, and only once. The comparision is done the same way, as it would be for `string.Replace`.\n\n`\"MyTestTest\".TrimEnd(\"Test\") == \"MyTest\" == true`\n\n**Second overload:**\n\n`public string TrimEnd(string suffix, StringComparison comparison)`\n\nWorks as the first one, but allows you to explictly tell how to compare.\n\n`\"MyTESTtest\".TrimEnd(\"test\", StringComparison.InvariantCultureIgnoreCase) == \"MyTEST\" == true`\n\n**Third overload(s):**\n\nI am not sure if these are needed, but I wanted to throw this out here anyway:\n\n```\npublic string TrimEnd(string suffix, bool trimRepeatedly) \npublic string TrimEnd(string suffix, bool trimRepeatedly StringComparison comparison) \n\"MyTestTEST\".TrimEnd(\"test\", true, StringComparison.InvariantCultureIgnoreCase) == \"My\" == true\n```\n\nThis proposal has nothing to do with string.Trim(), as it would be ambigious.  `\"tetet\".Trim(\"tet\") == ???`\n\nNamespace: _System_\nType: _System.String_\nAssembly: _System.Runtime.dll_\n\nI'd be willing to work on this :3\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/269365505","html_url":"https://github.com/dotnet/corefx/issues/1244#issuecomment-269365505","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/1244","id":269365505,"user":{"login":"danmosemsft","id":6385855,"avatar_url":"https://avatars.githubusercontent.com/u/6385855?v=3","gravatar_id":"","url":"https://api.github.com/users/danmosemsft","html_url":"https://github.com/danmosemsft","followers_url":"https://api.github.com/users/danmosemsft/followers","following_url":"https://api.github.com/users/danmosemsft/following{/other_user}","gists_url":"https://api.github.com/users/danmosemsft/gists{/gist_id}","starred_url":"https://api.github.com/users/danmosemsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmosemsft/subscriptions","organizations_url":"https://api.github.com/users/danmosemsft/orgs","repos_url":"https://api.github.com/users/danmosemsft/repos","events_url":"https://api.github.com/users/danmosemsft/events{/privacy}","received_events_url":"https://api.github.com/users/danmosemsft/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T18:42:32Z","updated_at":"2016-12-27T18:42:32Z","body":"@ChrisEelmaa do you have interest in updating the proposal here? "}}
{"actor":{"display_login":"danmosemsft"}}