View Single Post
09/17/15, 12:01 AM   #9
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
Originally Posted by Wandamey View Post
i'd say ^ns = neutral singular (forces singular form even with qtt > 1). kinda obvious for materials but there are others.

you can safely make a pattern to remove everything after ^ (lua or not) imo

these ^gendernumber are in almost every word in french and german, with more variations, so it wouldn't be a waste to do like that
I second this. Instead of replacing specific formatting strings you should use a regex and strip it regardless of the format in use.

using System.Text.RegularExpressions;

...
string line = "|H0:item:533:30:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|hsanded oak^ns|h";
Regex expr = new Regex(@"\^.*\|"); // match any number of characters between a caret and pipe
string result = expr.Replace(line, "|");
Console.WriteLine(result);
or if you already stripped the name you can simply write
string line = "sanded oak^ns";
Regex expr = new Regex(@"\^.*"); // match any number of characters after a caret
string result = expr.Replace(line, "");
  Reply With Quote