I read dozens of posts but it looks like many things have changed with strings between Swift 2, Swift 3 and Swift 4, and I could not find a useful example of something working.
I'm currently using Swift 3.1.
I get some strings from a server and I need to left trim the zeroes and convert them to integers.
The strings come in this format:
"00000123", "00123456", "012" and "000" too.
So, the string 00000123 should become 123, 012 should be converted to the integer 12 and 000 (and 0000, 00000, 000000, etc.) should be converted to 0.
Can you help me?