input: Write a function to convert an HTML string to plain text without using any external libraries. The function should strip out all HTML tags and return the clean text.
  
  def html_to_text(html_string):
      output = ''
      in_tag = False
      for char in html_string:
          if char == '<':
              in_tag = True
          elif char == '>':
              in_tag = False
          elif in_tag == False:
              output += char
      return output
  
  assert html_to_text("<p>Hello, <b>world</b>!</p>")=="Hello, world!"
  assert html_to_text("<div><h1>Title</h1><p>This is a paragraph.</p></div>")=="TitleThis is a paragraph."
  assert html_to_text("<a href='http://example.com'>Link</a>")=="Link"
  assert html_to_text("")==""
  assert html_to_text("This is plain text.")=="This is plain text."
output: def html_to_text(html_string):
      output = ''
      in_tag = False
      for char in html_string:
          if char == '<':
              in_tag = True
          elif char == '>':
              in_tag = False
          elif in_tag == False:
              output += char
      return output