/* Strip whitespace from a string/Top and tail (Rosetta code) in Picat. http://rosettacode.org/wiki/Strip_whitespace_from_a_string/Top_and_tail """ The task is to demonstrate how to strip leading and trailing whitespace from a string. The solution should demonstrate how to achieve the following three results: - String with leading whitespace removed - String with trailing whitespace removed - String with both leading and trailing whitespace removed For the purposes of this task whitespace includes non printable characters such as the space character, the tab character, and other such characters that have no corresponding graphical representation. """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import util. main => go. go => S = " Jabberwocky ", println("<" ++ S ++ ">"), println("<" ++ lstrip(S) ++ ">"), println("<" ++ rstrip(S) ++ ">"), println("<" ++ strip(S) ++ ">"), println("<" ++ strip("\t\r\bTwas brillig, and the slithy toves\r \t\v"," \b\v\t\r\v") ++ ">"), nl.