     ///     print(string.prefixed(length: 7))
     ///     // Prints "Hello W"
     ///
-    /// - Parameters:
-    ///   - length: The length of the string that you'd like to return, starting at the beginning of the string. If the provided length is greater than the original string, the original string is returned.
+    /// - Parameter length: The length of the string that you'd like to return, starting at the beginning of the string. If the provided length is greater than the original string, the original string is returned.
     /// - Returns: A prefixed copy of the string.
     @discardableResult
     func prefixed(length: Int) -> String {


private extension String {

    func padConditionsSatisfied(token: String, length: Int) -> Bool {
        guard length > characters.count else {
            return false
        }

        guard token.characters.count == 1 else {
            return false
        }

        return true
    }

    func containsCharactersFound(in characterSet: CharacterSet) -> Bool {
        for scalar in unicodeScalars {
            guard characterSet.contains(scalar) else {

    /// - Returns: The right-padded copy of the string.
    @discardableResult
    func padRight(token: String = " ", length: Int) -> String {
        guard padConditionsSatisfied(tokenCount: token.characters.count, length: length) else { return self }

        var s = self
        repeat { s.insert(token.characters[token.startIndex], at: endIndex) } while s.characters.count < length
