Home Common type conversions for basic data types across different programming languages.
Post
Cancel

Common type conversions for basic data types across different programming languages.


Convert Swift string to array

1
2
3
4
5
//above swift 5.3
let string = "Hello world"
let characters = Array(string)

print(characters)
1
2
3
4
5
var array = ["1", "2", "3"]

let stringRepresentation = "-".join(array) // "1-2-3"

This post is licensed under CC BY 4.0 by the author.

Best ChatGPT Coding Prompt Ever

Leetcode | 刷题准备