Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
197 stars 9 forks source link

Add StringComparison to Index Of String #3547

Open Frozenreflex opened 2 years ago

Frozenreflex commented 2 years ago

Is your tweak request related to a problem? Please describe.

Index Of String does not currently allow setting a StringComparison.

Describe what would you like tweaked

Index Of String to use IndexOf(String, Int32, StringComparison) instead of IndexOf(String, Int32), the method the node currently uses, and to add an input for a StringComparison.

Describe alternatives you've considered

In my case, I don't need one, but Ordinal performs better than CurrentCulture, and the different StringComparisons output different results, which could affect other use cases. IndexOf(String, Int32) uses CurrentCulture:

public int IndexOf(string value, int startIndex)
{
    return IndexOf(value, startIndex, StringComparison.CurrentCulture);
}

Additionally, ReplaceSubstring, ReplaceFirstSubstring, StartsWith, and EndsWith could also accept a StringComparison, but don't.

Additional context

No response

ProbablePrime commented 2 years ago

I was working on that this week actuallly :)

https://discord.com/channels/402159838827905024/533553295956901918/932947767066759199

it just kinda happened as a result of another node.