Support for int IndexOf(string value, int startIndex)
See original GitHub issueCurrently
We Currently have an implementation of int IndexOf(string value)
calling column.IndexOf("#") <= 1
that gets (roughly) translated into `
LOCATE('#', `j`.`column`) - 1) > 1
Implementing int IndexOf(string value, int startIndex)
means we can use the form LOCATE('#',column,X)=0
for column.IndexOf("#", X) == -1
.
A way to currently achieve this implementation is to use Substring(1).IndexOf("#") == -1
which however results in a fairly interesting:
(LOCATE('#', SUBSTRING(`j`.`column`, 1 + 1, CHAR_LENGTH(`j`.`column`))) - 1) = -1
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
String.IndexOf Method (System)
Reports the zero-based index of the first occurrence of the specified Unicode character in this string. The search starts at a specified character...
Read more >C# | String.IndexOf( ) Method | Set - 1
IndexOf (char x, int start1) method. This method returns the zero-based index of the first occurrence of the specified character within the ...
Read more >C# IndexOf Examples
We use IndexOf to see if a string contains a word. Usually we want to know the exact result of IndexOf. We can...
Read more >C# - String IndexOf method with second argument equal to ...
So for the count parameter above, the value this.Length - startIndex is passed. Since startIndex is equal to the length, count will be...
Read more >String IndexOf is missing API for char with start index and ...
The string IndexOf API is missing two methods for char that it has with string . It's currently not possible to perform an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for your update. I’m just a normal contributor 😄 and the edit button is hidden to me.
@mguinness @lauxjpn @LeaFrock it turns out this actually was implemented for SQL Server in https://github.com/dotnet/efcore/pull/26623, for 7.0.0-preview.1. There’s a specification test for it as well, but since it was using a top-most projection, the test can client-eval and always passes regardless of whether a provider implements translation support or not. I opened https://github.com/dotnet/efcore/pull/28031 to improve the tests.
Note that SQLite and PostgreSQL do not have a function which accepts a start position parameter.