practicalswift/Pythonic.swift — pull request #14 by natecook1000 (2014-08-15 21:11:26+00:00)
Title: Added Pythonic string indexing and cleaned up subscript methods

The Pythonic string indexing works like this:

```python
word = "Python"
word[2:] # "Py"
word[:2] # "thon"
word[1:-1] # "ytho"
```

```swift
let word = "Swift"
word[2,nil] // "Sw"
word[nil,2] // "ift"
word[1,-1] // "wif"
```

The changes to the other `subscript` methods are for efficiency, so we're not iterating the entire string whenever accessing a part. (We still have to iterate up through the end index, however.)