Skip to content

Conversation

@Dracape
Copy link

@Dracape Dracape commented Jan 2, 2026

In the NuShell book/Nu Fundamentals/Working with strings/The str command/Substrings (book/working_with_strings.md),
the command 'Hello World!' | str substring 4..8''s output is given as o Wo—which would be correct if 8 wasn't included and the output would be of 4 characters, as given in the book.

Running the command internally has shown that 8—in fact inculded in the substring so the correct output shown in the comment should be o Wor (of 5 characters) as it is in the cheat sheet and not o Wo

@Dracape Dracape changed the title Book:Fix incomplete substring output Book: Fix incomplete substring output Jan 2, 2026
@fdncred
Copy link
Contributor

fdncred commented Jan 2, 2026

I'm sure the syntax has changed since the docs were written. This would also work

'Hello World!' | str substring 4..<8

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants