public int GetAbilityScoreValue(string ScoreName) { if (ScoreName.Length == 0) { return(-100); } AbilityScores = AbilityScores.Replace("*", string.Empty); List <string> Scores = AbilityScores.Split(',').ToList(); string temp = string.Empty; foreach (string score in Scores) { if (score.Contains(ScoreName)) { temp = score.Replace(ScoreName, string.Empty).Trim(); if (temp == "-") { temp = "0"; } if (temp.IndexOf(PathfinderConstants.PAREN_LEFT) >= 0) { temp = temp.Substring(0, temp.IndexOf(PathfinderConstants.PAREN_LEFT)); } return(Convert.ToInt32(temp)); } } return(-100); }