Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.36 KB | None | 0 0
  1. //: Playground - noun: a place where people can play
  2.  
  3. import UIKit
  4.  
  5. var text = "Nikita go to school everyday. Nikita is a good boy. Nikita loves anime and hate music."
  6.  
  7. extension String {
  8.     func replaceNikitaWith(name: String) -> String {
  9.         return self.replacingOccurrences(of: "Nikita", with: name)
  10.     }
  11. }
  12.  
  13. text.replaceNikitaWith(name: "Ruslan")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement