I have a List<String> which contains values like Char:Char_Number1_Number2.
I want to find the index or replace the value, by searching Number1_Number2, the combination of Number1_Number2 is always unique.
EG: B:S_4_0 will be replaced as B:S_5_1 , But searching criteria is 4_0
B:S_4_0
B:N_1_2
A:N_3_3
B:N_0_0
A:S_2_5
A:S_3_4
I want these tasks
- How to find the index or complete value by using the second half of the string
- How to replace or remove a specific value by using the second half of the string
int index = Player1.IndexOf("5_6"); // Find Index
Player1[index]="5_6"; // Replace value
Player1.Remove("5_6"); // Remove
References
How to replace some particular string in a list of type string using linq
num_numcan't be converted to an int. Are you looking to make this into string key?