SwiftKotlin icon indicating copy to clipboard operation
SwiftKotlin copied to clipboard

Transform foundation methods

Open angelolloqui opened this issue 7 years ago • 2 comments

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()

angelolloqui avatar Oct 31 '17 09:10 angelolloqui

Check #14 also

angelolloqui avatar Nov 28 '17 22:11 angelolloqui

Work started with 8b94a81d40d0b403d4095bc190cafe1e272ed96d but still WIP

angelolloqui avatar Dec 10 '17 19:12 angelolloqui