Function to apply to each character
A function that takes a string and returns the mapped string
const toUpperCase = (c: string) => c.toUpperCase();
mapStr(toUpperCase)('hello') // 'HELLO'
mapStr(c => c === 'o' ? '0' : c)('hello world') // 'hell0 w0rld'
* mapStr(c => c === 'r' ? 'ru' : c)('kirara') // 'kiruarua'
mapStr(c => c === 'a' ? '' : c)('sango') // 'sngo'
Generated using TypeDoc
Maps over each character in a string using the provided function.