Created
June 3, 2016 08:19
-
-
Save nsomar/04915deac33bb8b72a50880bc4021e49 to your computer and use it in GitHub Desktop.
Inset a string one character from start and end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let string = "This is the string" | |
let start = string.index(string.startIndex, offsetBy: 1) | |
let end = string.index(string.endIndex, offsetBy: -1) | |
string[start..<end] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment