Use Lambda to find the index in the List and use this index to replace the list item.
List<string> listOfStrings = new List<string> {"abc", "123", "ghi"};
listOfStrings[listOfStrings.FindIndex(ind=>ind.Equals("123"))] = "def";
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…