Hello @HBoskugelS,
Welcome to the community!
This behavior has already been discussed.
Your ++int_Position
usage can be translated to int_Position = int_Position + 1
:
else
{
obj_Options.Add(str_Option.Substring(1, int_Position - 1),
str_Option.Substring(int_Position = int_Position + 1));
}
Which leads to an unused assignment.
Then, I would suggest replacing ++int_Position
with int_Position + 1
.
You can find here the previous discussion about this:
- Csharpsquid: S1854 reports false positive for pre-increment - #11 by Mary_Georgiou
- False positive on rule csharpsquid:S1854
Have a nice day!