Swift's String module in TypeScript


We have 8 Swift functions so far - help us add more

Got a rainy Sunday afternoon and a taste for a porting puzzle?

  • Get inspiration from the Swift documentation.
  • Click "New file" in the appropriate folder on GitHub. This will fork the project to your account, directly add the file to it, and send a Pull Request to us.

We will then review it. If it's useful to the project and in line with our contributing guidelines your work will become part of Locutus and you'll be automatically credited in the authors section accordingly.

Upstream Surface Inventory 3/104 shipped • 101 next 3%

Namespace-level inventory for Swift 6.0: what we already ship, what we may still want, and what we intentionally skip or keep.

String

Swift 6.0 · Catalog source: live runtime snapshot swift:6.0:String

3% shipped
3/104 shipped 101 next 5 intentional extras
Shipped (8)

Next

Swift String helpers are strong plain-value portability targets.

  • !=
  • ...
  • ..<
  • +
  • +=
  • <
  • <=
  • ==
  • >
  • >=
  • ~=
  • allSatisfy
  • append
  • applying
  • characters
  • CharacterView
  • codingKey
  • compactMap
  • contains
  • count
  • customMirror
  • customPlaygroundQuickLook
  • debugDescription
  • decodeCString
  • description
  • difference
  • distance
  • drop
  • dropFirst
  • dropLast
  • Element
  • elementsEqual
  • encode
  • encodedOffset
  • endIndex
  • enumerated
  • filter
  • first
  • firstIndex
  • flatMap
  • forEach
  • formIndex
  • hash
  • index
  • Index
  • IndexDistance
  • indices
  • init
  • insert
  • isContiguousUTF8
  • isEmpty
  • Iterator
  • last
  • lastIndex
  • lazy
  • lexicographicallyPrecedes
  • lowercased
  • makeContiguousUTF8
  • makeIterator
  • map
  • max
  • min
  • next
  • popLast
  • prefix
  • randomElement
  • reduce
  • remove
  • removeAll
  • removeFirst
  • removeLast
  • removeSubrange
  • removeSubranges
  • removingSubranges
  • replaceSubrange
  • reserveCapacity
  • reversed
  • samePosition
  • shuffled
  • sorted
  • startIndex
  • starts
  • subscript
  • SubSequence
  • suffix
  • underestimatedCount
  • UnicodeScalarIndex
  • unicodeScalars
  • UnicodeScalarView
  • uppercased
  • utf16
  • utf16Offset
  • UTF16View
  • utf8
  • utf8CString
  • UTF8View
  • withContiguousStorageIfAvailable
  • withCString
  • withMutableCharacters
  • withUTF8
  • write

Intentional extras

« More Swift functions