I have a method that to remove the description word base on the string, but I believe that there is more efficient way to do this.
The iMonster can be like fat orc rogue, and I want to remove the fat.
private static string[] _adjectives = { "angry",
"big",
"fat",
"happy",
"large",
"nasty",
"fierce",
"thin",
"small",
"tall",
"short" };
private static string RemoveMonsterAdjective(string iMonster)
{
foreach (string adjective in _adjectives)
{
if (iMonster.Contains(adjective))
{
iMonster = iMonster.Replace(adjective, "").Trim();
break;
}
}
return iMonster;
}
hopefully someone can help me. Thanks in advance.
breakif the imonster is a "big fat nasty orc rogue" you will get "fat nasty orc rogue" as the result.adjectivesarray, it seems fine. But you would need a way to elminitae multipleadjectiveslike removing multiple delimiters ;) +1 @nemesv