Skip to content

Instantly share code, notes, and snippets.

@clarkeben
Last active September 11, 2023 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarkeben/77fcc5dcb667cc075cda720118ea7903 to your computer and use it in GitHub Desktop.
Save clarkeben/77fcc5dcb667cc075cda720118ea7903 to your computer and use it in GitHub Desktop.
swift-split-string
let car = "BMW,Tesla,Range,Porsche"
let cars = car.components(separatedBy: ",") //["BMW", "Tesla", "Range", "Porsche"]
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