Skip to content

Commit

Permalink
Remove digit from item name
Browse files Browse the repository at this point in the history
  • Loading branch information
C1rdec committed Jan 11, 2020
1 parent 373c253 commit 09b326c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Lurker/Events/TradeEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace Lurker.Events
using Lurker.Models;
using System;
using System.Linq;
using System.Text.RegularExpressions;

public class TradeEvent : WhisperEvent
{
Expand Down Expand Up @@ -130,13 +131,18 @@ public static Price ParsePrice(string priceValue)
};
}

/// <summary>
/// Simplifies the name of the item.
/// </summary>
private void SimplifyItemName()
{
var additionalInformationIndex = this.ItemName.IndexOf(" (");
if (additionalInformationIndex != -1)
{
this.ItemName = this.ItemName.Substring(0, additionalInformationIndex);
}

this.ItemName = Regex.Replace(this.ItemName, @"[\d-]", string.Empty).Trim();
}

#endregion
Expand Down

0 comments on commit 09b326c

Please sign in to comment.