title: What is the best way to convert a UI text to string in Unity (C#)?
body: <p>i'm trying to make a code that changes the text of the UI by a string variable that's in another function but i get this </p>
  
  <blockquote>
    <p>error: Assets/Scripts/ChangeQuestion1.cs(15,26): error CS0029: Cannot
    implicitly convert type <code>UnityEngine.UI.Text' to</code>string</p>
  </blockquote>
  
  <p>What is the best way to convert a UI text to a string?
  I'm sorry if this question sound noobish. 
  Here's the code:</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  
  public class ChangeQuestion1 : MonoBehaviour {
  
      public GameObject databaseinterfaceinstance;
  
      public Text Question1;
      // Use this for initialization
      void Start () {
          databaseinterfaceinstance = GameObject.FindWithTag("DatabaseInterface").GetComponent&lt;GameObject&gt;();
          Question1 = gameObject.GetComponent&lt;Text&gt;();
          Question1.text = Question1;
      }
  
      // Update is called once per frame
      void Update () {
  
      }
  }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I already solved the problem, it was more complicated than that. The variable i was trying to print in canvas was from a script to connect with a database and i forgot to call some functions too.</p>