|
41 | 41 | (if (= _e "V") (set _e "v") |
42 | 42 | (if (= _e "W") (set _e "w") |
43 | 43 | (if (= _e "X") (set _e "x") |
| 44 | + (if (= _e "Y") (set _e "y") |
44 | 45 | (if (= _e "Z") (set _e "z") |
45 | 46 | (if (= _e "Â") (set _e "â") |
46 | 47 | (if (= _e "À") (set _e "à") |
|
58 | 59 | (if (= _e "Í") (set _e "í") |
59 | 60 | (if (= _e "Î") (set _e "î") |
60 | 61 | (if (= _e "Ï") (set _e "ï") |
61 | | - (if (= _e "Ô") (set _e "ô") ())))))))))))))))))))))))))))))))))))))))))) |
| 62 | + (if (= _e "Ô") (set _e "ô") ()))))))))))))))))))))))))))))))))))))))))))) |
62 | 63 | # End conditions |
63 | 64 | (set _output (+ _output _e)) |
64 | 65 | (set _index (+ _index 1)) |
|
171 | 172 | # @param _length the length of the slice |
172 | 173 | # @author https://github.com/Natendrtfm |
173 | 174 | ### |
174 | | -(let str:slice (fun (_string _startingIndex _length) { |
175 | | - (assert (>= _length 1) "slice length must be greater or equal to 1") |
176 | | - (assert (and (>= _startingIndex 0) (< _startingIndex (len _string))) "slice start index must be in range [0, string length[") |
| 175 | +(let str:slice (fun (_string _startingIndex _length) |
| 176 | + (if (= _length 0) |
| 177 | + "" |
| 178 | + { |
| 179 | + (assert (and (>= _startingIndex 0) (< _startingIndex (len _string))) "slice start index must be in range [0, string length[") |
177 | 180 |
|
178 | | - (mut _returnedString "") |
179 | | - (mut _index _startingIndex) |
180 | | - (let _end (if (> _length (len _string)) (len _string) (+ _index _length))) |
| 181 | + (mut _returnedString "") |
| 182 | + (mut _index _startingIndex) |
| 183 | + (let _end (if (> _length (len _string)) (len _string) (+ _index _length))) |
181 | 184 |
|
182 | | - (while (< _index _end) { |
183 | | - (set _returnedString (+ _returnedString (@ _string _index))) |
184 | | - (set _index (+ _index 1)) |
185 | | - }) |
186 | | - _returnedString |
187 | | -})) |
| 185 | + (while (< _index _end) { |
| 186 | + (set _returnedString (+ _returnedString (@ _string _index))) |
| 187 | + (set _index (+ _index 1)) |
| 188 | + }) |
| 189 | + _returnedString |
| 190 | + }) |
| 191 | +)) |
188 | 192 |
|
189 | 193 | ### |
190 | 194 | # @meta String |
|
0 commit comments