I want to print list of strings like shown below.
|Name|Country|Age|
------------------
|1 |USA |20 |
|2 |UK |19 |
I was able to achieve this using the following.
printfieldName :: [String] -> String
printfieldName [] = []
printfieldName (x:xs) = "|" ++ x ++ "\t" ++ printfieldName (xs)
Is it possible to achieve this using the inbuilt function 'unwords'. I was able print it using 'unwords' but was unable to place |
between the words.