query
On this page

stringAsChars

lib.stringAsChars

Docs pulled from | This Revision | 10 minutes ago


Manipulate a string character by character and replace them by strings before concatenating the results.

Inputs

f
Function to map over each individual character
s
Input string

Type

stringAsChars :: (string -> string) -> string -> string

Examples

lib.strings.stringAsChars usage example

stringAsChars (x: if x == "a" then "i" else x) "nax"
=> "nix"
(lib.strings.stringAsChars)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

stringAsChars =
    # Function to map over each individual character
    f:
    # Input string
    s:
    concatStrings (map f (stringToCharacters s));