Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contains("<<Something") doesn't return true while it should #779

Closed
Ellerbach opened this issue Jun 18, 2021 · 3 comments · Fixed by nanoframework/CoreLibrary#148
Closed

Comments

@Ellerbach
Copy link
Member

Details about Problem

nanoFramework area: C# code

VS version: (2017 | 2019 )

VS extension version:

Target:

Device capabilities output:

Description

Issue with string.Contains for a specific character string.

Detailed repro steps so we can see the same problem

const string C9PatternMainStyle = "<<Main>$>g__";
string mtName = "<<Main>$>g__MethodCalbackTest|0_3";
if (mtName.Contains(C9PatternMainStyle))
{
  // We should arrive here but Contains doesn't find it!
}

Notes:

  • Works: mtName.Contains("Main>$>"))
  • Does not work: mtName.Contains("<<Main"))

Other suggested things

Expected behaviour

Sample Project

Screenshot

Additional context

I've made an effort to fix the bug

@josesimoes
Copy link
Member

Our API currently has no Contains(...) and friends. We should look into adding these.
Most of them can (are) pure C# code, so they won't "cost" anything in native size increase.

@Ellerbach
Copy link
Member Author

You're right :-) My bad :-D It's an extension I have and the issue is in the extension! Found my issue.

@josesimoes
Copy link
Member

Almost ready. Just adding a pile of unit tests 😜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants