code: def word_wrap(self, text, width=1023):
          
          substrings = []
  
          string = text
          while len(string) > width:
              index = width - 1
              while not string[index].isspace():
                  index = index - 1
  
              line = string[0:index]
              substrings.append(line)
  
              string = string[index + 1:]
  
          substrings.append(string)
  
          return substrings
docs: A simple word wrapping greedy algorithm that puts
          as many words into a single string as possible.