<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def toString(val, join_char='\n'):
 """ Turn a string or array value into a string. """

        if type(val) in (list, tuple):
            return join_char.join(val)
        return val