16 lines
428 B
Swift
16 lines
428 B
Swift
import Foundation
|
|
|
|
extension String {
|
|
var firstLetter: String {
|
|
String(prefix(1)).uppercased()
|
|
}
|
|
|
|
var makeReply: String {
|
|
let allLines = components(separatedBy: .newlines)
|
|
let nonBlankLines = allLines.filter { !$0.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty }
|
|
var result = nonBlankLines.joined(separator: "\n")
|
|
result = "> \(result)"
|
|
return result
|
|
}
|
|
}
|