This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var meuTexto: String = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func calc(_ expression: String) -> Double { | |
| var elements: [String] = [] | |
| let operators = ["*","/","+","-"] | |
| var current = "" | |
| for item in expression { | |
| let char = String(item) | |
| let last = elements.last ?? "" | |
| if char == " " { |
OlderNewer