Creates a string with the results of calling the provided function on every character in the given string.

Use String.split('') and to call the provided function, fn, for each character in str.
Use Iterable.join('') to recombine the list of runes into a string.


String mapString(String str, String Function(String c) fn) {
  return str.split('').map(fn).join('');


mapString('lorem ipsum', (c) => c.toUpperCase()); // 'LOREM IPSUM'