Mini-exercises

  1. Implement a custom multiplication operator for strings so that the following code works:

let baseString = "abc" let times = 5

var multipliedString = baseString ** times

  1. Implement the corresponding multiplication assignment operator from the previous exercise so that the following code runs without errors:

multipliedString **= times

results matching ""

    No results matching ""