How To Split Array Of Data in Swift
How To Split Array Of Data in Swift
I am Getting the array of Data from Remote Server
which is as follow
var i :[Data] = myImageData as [Data]
which is printing as follow
var i is --- > [4927 bytes, 5945 bytes, 7556 bytes]
and I want to remove Braces , I want to get list
like this
var i is --- > 4927 bytes, 5945 bytes, 7556 bytes
@TheNitram its Splitting String , Not [Data]
– Rishabh Shukla
Jun 29 at 16:10
Something like that:
let dataAraryDescription = myImageData.map({ String($0.description)}) joined(separator:", ")
? You might event to use ByteFormatter
if needed.– Larme
Jun 29 at 16:10
let dataAraryDescription = myImageData.map({ String($0.description)}) joined(separator:", ")
ByteFormatter
@Larme Can You Explain it in Detail I am not Getting it
– Rishabh Shukla
Jun 29 at 16:13
try to remplace [ with "" like this text = i.replacingOccurrences(of: "[", with: "", options: NSString.CompareOptions.literal, range: nil);
– Younes Zaidi
Jun 29 at 16:33
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Have you checked this? stackoverflow.com/questions/32074136/…
– TheNitram
Jun 29 at 16:08