another.im-ios/ConversationsClassic/Helpers/String+Extensions.swift
2024-06-27 13:39:41 +02:00

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
}
}