<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nts(self, s):
 """ Convert a null-terminated string field to a python string. """

        # Use the string up to the first null char.
        p = s.find("\0")
        if p == -1:
            return s
        return s[:p]