Hello to all, i have a and i would like to remove the white Space after "\n" and next character is white space.
For instance, "username 123\n ugas 423\n peter 23\n asd234" become
"username 123\nugas 423\npeter 23\nasd234"
Please help.
Thanks.
Hello to all, i have a and i would like to remove the white Space after "\n" and next character is white space.
For instance, "username 123\n ugas 423\n peter 23\n asd234" become
"username 123\nugas 423\npeter 23\nasd234"
Please help.
Thanks.
I am assuming you want to remove one or more whitespace characters at the beginning of each line, not just the first whitespace character. Also, I think you want to remove any kind of whitespace characters, like tabs, not just literal space characters.
import Data.Char
stripLeadingWhitespace :: String -> String
stripLeadingWhitespace = unlines . map (dropWhile isSpace) . lines