Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

swift convert array to json

func json(from object:Any) -> String? {
    guard let data = try? JSONSerialization.data(withJSONObject: object, options: []) else {
        return nil
    }
    return String(data: data, encoding: String.Encoding.utf8)
}
 
PREVIOUS NEXT
Tagged: #swift #convert #array #json
ADD COMMENT
Topic
Name
4+8 =