Skip to content

Commit

Permalink
Fix backtick logic for explicitly implemented non-generic members of …
Browse files Browse the repository at this point in the history
…generic interfaces.
  • Loading branch information
StephenCleary committed Sep 28, 2017
1 parent d616c36 commit ca3a520
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/DotNetApis.Common/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public static string AtEncode(this string text, char[] alphabet)
/// </summary>
public static (string Name, int Value) StripBacktickSuffix(this string s)
{
var backtickIndex = s.IndexOf('`');
if (backtickIndex == -1)
var backtickIndex = s.LastIndexOf('`');
if (backtickIndex == -1 || backtickIndex < s.LastIndexOf('.'))
return (s, 0);
return (s.Substring(0, backtickIndex), int.Parse(s.Substring(s.LastIndexOf('`') + 1), CultureInfo.InvariantCulture));
}
Expand Down

0 comments on commit ca3a520

Please sign in to comment.