Slicing is basically getting a substring from a string. It is similar to indexing, except that it usually contains multiple characters. Like most other operations a functions, it is zero-indexed.


"Hello World!"[4:9]
o Worl

If the first argument is omitted, the slicing starts at the start of the string. If the last argument is omitted, the slicing ends at the end of the string.

"Hello World!"[:9]
Hello Worl
"Hello World!"[4:]
o World!
"Hello World!"[:]
Hello World!
(The string itself.)

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.