There is this guy in one forum, writing all his sentences ending with at least two periods, mostly three… Always… This might help him, integrated into some text editor… Saving his keyboard strokes…
extension String { static postfix func ... (str: inout String) -> String { str = String(str.map { $0 == "." ? "…" : $0 }) return str } } var sentence = "Operator dotdotdot. For those. Who want to write. All sentences. With several periods." let hisStyle = sentence... print(hisStyle) // Prints: "Operator dotdotdot… For those… Who want to write… All sentences… With several periods…"
What about adding a copyright at the end of text the user enters, using this brand new copyright operator, <©>
postfix operator <©> extension String { static postfix func <©> (str: inout String) -> String { str += " © Antti J." return str } } var originalText = "Life is a b***h and then you die." var copyrighted = originalText<©> print(copyrighted) // Prints: "Life is a b***h and then you die. © Antti J."
Well, back to some more serious work.