Last active
June 4, 2020 15:37
-
-
Save froggomad/26a1b9dfd620b87aff2e586005d91989 to your computer and use it in GitHub Desktop.
firstTwoChars = * and lastTwoChars = *
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
// Created by Kenny Dubroff on 10/14/18. | |
var str = "p123869" | |
var chars = Array(str) | |
//first 2 characters are always 0 and 1 | |
chars[0] = "*" | |
chars [1] = "*" | |
///endIndex is always one greater than the last index | |
let endIndex = chars.endIndex - 1 | |
let nextToEndIndex = endIndex - 1 | |
chars[endIndex] = "*" | |
chars[nextToEndIndex] = "*" | |
print(chars) //**238** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment