localized string format swift

Swift
// you should have "account.by_user" = "by %@ and %@"; and take this:

let localizedString = NSLocalizedString("account.by_user", comment: "any comment")
let wantedString = String(format: localizedString, "Peter","Larry")

Source

Also in Swift: