e3bb00c0db49
Tweak wording.
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Fri, 12 Oct 2012 19:28:17 -0400 |
| parents | 255d5232b0f6 |
| children | 405fe87b3cf8 |
| branches/tags | (none) |
| files | chapters/35.markdown |
Changes
--- a/chapters/35.markdown Fri Oct 12 19:25:40 2012 -0400 +++ b/chapters/35.markdown Fri Oct 12 19:28:17 2012 -0400 @@ -76,12 +76,14 @@ :::vim :echo "abcd"[0:2] -Vim displays "abc". It does not allow you to use negative indices with strings though: +Vim displays "abc". However, you can't use negative bare indices with strings. +You *can* use negative indices when slicing strings though! Run the following +command: :::vim - :echo "abcd"[-1] "abcd"[-1:] + :echo "abcd"[-1] . "abcd"[-2:] -will echo " d". +Vim displays "cd" (using a negative index silently resulted in an empty string). Concatenation -------------