Read a string from Stream, providing functionality similar to
split_string/4. 
The predicate performs the following steps:
- Skip all characters that match PadChars
- Read up to a character that matches SepChars or end of 
file
- Discard trailing characters that match PadChars from the 
collected input
- Unify String with a string created from the input and
Sep with the code of the separator character read. If input 
was terminated by the end of the input, Sep is unified with 
-1.
The predicate read_string/5 
called repeatedly on an input until
Sep is -1 (end of file) is equivalent to reading the entire 
file into a string and calling split_string/4, 
provided that SepChars and PadChars are not partially 
overlapping.174Behaviour that 
is fully compatible would require unlimited look-ahead. 
Below are some examples:
Read a line:
read_string(Input, "\n", "\r", Sep, String)
Read a line, stripping leading and trailing white space:
read_string(Input, "\n", "\r\t ", Sep, String)
Read up to‘,’or‘)’, 
unifying Sep with 0', i.e. Unicode 44, or 0'), 
i.e. Unicode 41:
read_string(Input, ",)", "\t ", Sep, String)