Files
resgen.swift/Tests/ResgenSwiftTests/Extensions/StringExtensions.swift
T
t.schmitt 58b049c629
openium/resgen.swift/pipeline/head This commit looks good
Migrate tests from XCTest to Swift Testing (#26)
Reviewed-on: #26
2026-11-23 16:25:37 +01:00

20 lines
395 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 adaptForTest() -> Self {
self
.split(separator: "\n")
.compactMap { String($0).removeLeadingTrailingWhitespace() }
.joined(separator: " - ")
}
}