func trim()

in Sources/XCRemoteCache/Shell/Shell.swift [102:118]


    func trim() -> String {
        func trim(_ separator: String) -> String {
            var E = endIndex
            while String(self[startIndex..<E]).hasSuffix(separator) && E > startIndex {
                E = index(before: E)
            }
            return String(self[startIndex..<E])
        }

        if hasSuffix("\r\n") {
            return trim("\r\n")
        } else if hasSuffix("\n") {
            return trim("\n")
        } else {
            return self
        }
    }