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

Slicing a string literal #537

Closed
elliottc opened this issue Jan 24, 2024 · 0 comments
Closed

Slicing a string literal #537

elliottc opened this issue Jan 24, 2024 · 0 comments
Labels

Comments

@elliottc
Copy link

elliottc commented Jan 24, 2024

go 1.21, expr 1.15.8

I noticed slicing a string literal is giving an error:

"hello"[1:3]

unexpected token Bracket("[") (3:8)

But slicing a string variable works:

let s = "hello"; s[1:3]

"el"

I was hoping they would give the same output.

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

No branches or pull requests

2 participants