Last active
September 11, 2023 11:54
-
-
Save clarkeben/77fcc5dcb667cc075cda720118ea7903 to your computer and use it in GitHub Desktop.
swift-split-string
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 car = "BMW,Tesla,Range,Porsche" | |
let cars = car.components(separatedBy: ",") //["BMW", "Tesla", "Range", "Porsche"] |
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 name = "Ben,Bob,Alice,Mallory" | |
var names = name.split(separator: ",") //["Ben", "Bob", "Alice", "Mallroy"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment