Yep… it’s one of those days.
public string TagsInput { get; set; }
//further down
var tagList = TagsInput.Split(Resources.GlobalResources.TagSeparator.ToCharArray()).ToList();
tagList.ForEach(tag => tag.Trim()); //trim each list item for spaces
tagList.ForEach(tag => tag.Replace(" ", "_")); //replace remaining inner word spacings with _
Both ForEach loops don’t work. tagList is just a List.
Thank you!
Trim()andReplace()don’t modify the string they’re called on. They create a new string that has had the action applied to it.You want to use
Select, notForEach.