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

index-of works on array but not string #345

Open
samer1977 opened this issue May 22, 2024 · 3 comments
Open

index-of works on array but not string #345

samer1977 opened this issue May 22, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@samer1977
Copy link

We developers always think of string as an array of chars and function that applies to arrays should apply to strings including index-of, size...etc.

@larsga larsga added the support Users asking how to solve a specific issue label May 22, 2024
@larsga
Copy link
Collaborator

larsga commented May 22, 2024

Slicing works for both arrays and strings. Size likewise. contains() searches for something in strings and arrays. It sounds like what you're asking for?

@samer1977
Copy link
Author

what Im looking for is similar to charindex function in sql, you pass string input and search char\chars and it will give the index of the first occurance

@larsga larsga added enhancement New feature or request and removed support Users asking how to solve a specific issue labels May 22, 2024
@larsga
Copy link
Collaborator

larsga commented May 22, 2024

Hmmm. Looks like you're right that that's missing. If so, it's pretty incredible that we didn't add that before. Yeah, we may have to add that, perhaps by extending index-of() to work on strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants