If you want to find a specific character in a string, you can code it as shown below:
let text = "John Appleseed"
text[3] // Returns the Character "h"
text[safe: 9] // Returns the Optional Character "l"
text[safe: 100] // Returns the nil
You can use The Swift Package Manager to install PTString-Subscript by addint the description to your Package.swift file:
dependencies: [
.package(url: "https://github.com/rlarjsdn3/String-Extension-Swift", from: "0.1.0")
]
pod "SwiftExtension"
SOWOL-KIM, [email protected]
PTStringSubscript is available under the MIT license. See the LICENSE file for more info.