From 09b326caa23f046f5f520b5814fd9e61f8577622 Mon Sep 17 00:00:00 2001 From: C1rdec Date: Sat, 11 Jan 2020 17:40:46 -0500 Subject: [PATCH] Remove digit from item name --- src/Lurker/Events/TradeEvent.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Lurker/Events/TradeEvent.cs b/src/Lurker/Events/TradeEvent.cs index 267fa7d5..b86e802e 100644 --- a/src/Lurker/Events/TradeEvent.cs +++ b/src/Lurker/Events/TradeEvent.cs @@ -10,6 +10,7 @@ namespace Lurker.Events using Lurker.Models; using System; using System.Linq; + using System.Text.RegularExpressions; public class TradeEvent : WhisperEvent { @@ -130,6 +131,9 @@ public static Price ParsePrice(string priceValue) }; } + /// + /// Simplifies the name of the item. + /// private void SimplifyItemName() { var additionalInformationIndex = this.ItemName.IndexOf(" ("); @@ -137,6 +141,8 @@ private void SimplifyItemName() { this.ItemName = this.ItemName.Substring(0, additionalInformationIndex); } + + this.ItemName = Regex.Replace(this.ItemName, @"[\d-]", string.Empty).Trim(); } #endregion