input: Write a function to convert HTML to plain text without using any libraries. The function should take a single string input containing HTML code and return a string with all HTML tags removed. If the input string is empty, it should return an empty string.
  
  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("<html><body><h1>Title</h1></body></html>")=="Title"
  assert html_to_text("<div><p>Hello World</p></div>")=="Hello World"
  assert html_to_text("<a href='example.com'>Link</a>")=="Link"
  assert html_to_text("<span style='color:red'>Red Text</span>")=="Red Text"
  assert html_to_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