Trims a String(NSString) in iOS on a certain side
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
String+StrippingPadding.swift

README.md

String-SideBasedTrimming

Trims a String in Swift on a given side.

This file is written in Swift 4, which requires Xcode 9+.

Methods

strippingPadding(off:, paddingCharacter: default) -> String

Given a side (and a padding character [defaults to "0"]), this method will return a new string with all instances of paddingCharacter removed from the given side. This will not affect instances of paddingCharacter in between other characters.

Enums

Side

  • beginning:

    • The beginning of the string
  • end:

    • The end of the string