SwiftKotlin
SwiftKotlin copied to clipboard
Transform foundation methods
List of some methods that could be transformed.
On List:
-
list.first
-->list.firstOrNull()
-
list.last
-->list.lastOrNull()
-
list.count
-->list.size
-
list.isEmpty
-->list.isEmpty()
-
list.index(of: a)
-->list.indexOf(a)
-
list.append(element)
-->list.add(element)
-
list.remove(at: index)
-->list.removeAt(index)
-
list.sorted(by: lambda)
-->sortedWith(comparator = Comparator(lambda))
-
list.joined(separator: joiner)
-->elements. joinToString(separator = joiner)
On String:
-
string.count
-->string.length
-
string.uppercased()
-->string.toUpperCase()
-
string.lowercased()
-->string.toLowerCase()
Check #14 also
Work started with 8b94a81d40d0b403d4095bc190cafe1e272ed96d but still WIP