code: def splice(self, new_str, start, end=None):
          
          if len(new_str) == 0:
              return self
          new_fs = new_str if isinstance(new_str, FmtStr) else fmtstr(new_str)
          assert len(new_fs.chunks) > 0, (new_fs.chunks, new_fs)
          new_components = []
          inserted = False
          if end is None:
              end = start
          tail = None
  
          for bfs, bfs_start, bfs_end in zip(self.chunks,
                                             self.divides[:-1],
                                             self.divides[1:]):
              if end == bfs_start == 0:
                  new_components.extend(new_fs.chunks)
                  new_components.append(bfs)
                  inserted = True
  
              elif bfs_start <= start < bfs_end:
                  divide = start - bfs_start
                  head = Chunk(bfs.s[:divide], atts=bfs.atts)
                  tail = Chunk(bfs.s[end - bfs_start:], atts=bfs.atts)
                  new_components.extend([head] + new_fs.chunks)
                  inserted = True
  
                  if bfs_start < end < bfs_end:
                      tail = Chunk(bfs.s[end - bfs_start:], atts=bfs.atts)
                      new_components.append(tail)
  
              elif bfs_start < end < bfs_end:
                  divide = start - bfs_start
                  tail = Chunk(bfs.s[end - bfs_start:], atts=bfs.atts)
                  new_components.append(tail)
  
              elif bfs_start >= end or bfs_end <= start:
                  new_components.append(bfs)
  
          if not inserted:
              new_components.extend(new_fs.chunks)
              inserted = True
  
          return FmtStr(*[s for s in new_components if s.s])
docs: Returns a new FmtStr with the input string spliced into the
          the original FmtStr at start and end.
          If end is provided, new_str will replace the substring self.s[start:end-1].