String to character list
1 answer
(Gathering comments in response)
Since haskell a String has a list of characters, i.e. [Char], will just return the input as indicated, will do.
example = id
does what you want. Please note that idis defined as
id x = x
Your example "jt5x=!" -> ["j","t","5","x","=","!"]does not match the description: Double quotes ""are Stringnot enclosed by single Charactors. Single quotes are used for characters '. You can enter
"jt5x=!" == ['j','t','5','x','=','!']
in GHCi and see what it returns True. Enter map (:[]) "jt5x=!"to see ["j","t","5","x","=","!"].
+6