Files
resgen.swift/Tests/ResgenSwiftTests/Extensions/StringExtensions.swift
Thibaut Schmitt 69ba5a53bf
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Add som units tests (split some code to made some part testable)
2022-09-06 15:35:15 +02:00

20 lines
397 B
Swift

//
// StringExtensions.swift
//
//
// Created by Thibaut Schmitt on 05/09/2022.
//
import Foundation
extension String {
/// Remove all new lines and leading/trailing whitespaces
func adaptForXCTest() -> Self {
self
.split(separator: "\n")
.compactMap { String($0).removeLeadingTrailingWhitespace() }
.joined(separator: " - ")
}
}