The
IndexOf
method returns the position of the given substring inside a string and returns a number. If the substring is not found, it returns -1.
In your case the code inside the
if
statement will only execute if
filename
contains the "?" character.
See
String.IndexOf()