Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //: Playground - noun: a place where people can play
- import UIKit
- var text = "Nikita go to school everyday. Nikita is a good boy. Nikita loves anime and hate music."
- extension String {
- func replaceNikitaWith(name: String) -> String {
- return self.replacingOccurrences(of: "Nikita", with: name)
- }
- }
- text.replaceNikitaWith(name: "Ruslan")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement