You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The string based IndexOf("\n") and LastIndexOf("\n") do not match Windows linebreaks (\r\n) but the character based IndexOf('\n') does. This contrasts with the behavior of Contains (and the apparent documented behavior of matching any substring) which matches \r\n for both Contains('\n') and Contains("\n").
Here's the output of IndexOf and LastIndexOf compared with Contains.
The string based IndexOf("\n") and LastIndexOf("\n") do not match Windows linebreaks (\r\n) but the character based IndexOf('\n') does. This contrasts with the behavior of Contains (and the apparent documented behavior of matching any substring) which matches \r\n for both Contains('\n') and Contains("\n").
Here's the output of IndexOf and LastIndexOf compared with Contains.
@gfs thanks for your report. This is a duplicate of #43736. Please have a look at the detailed discussion there and let's know of if you still have any question.
The string based
IndexOf("\n")
andLastIndexOf("\n")
do not match Windows linebreaks (\r\n
) but the character basedIndexOf('\n')
does. This contrasts with the behavior ofContains
(and the apparent documented behavior of matching any substring) which matches\r\n
for bothContains('\n')
andContains("\n")
.Here's the output of IndexOf and LastIndexOf compared with Contains.
Code to demonstrate the issue.
The text was updated successfully, but these errors were encountered: