Search Unity

How to copy string WITH its richtext formatting?

Discussion in 'Getting Started' started by CyberInteractiveLLC, Jul 17, 2019.

  1. CyberInteractiveLLC

    CyberInteractiveLLC

    Joined:
    May 23, 2017
    Posts:
    307
    I have String 1 which has rich formatting properties (Example Red Color, Bullet Points, etc)

    I run this
    Code (CSharp):
    1. String2.text = String1.Text;
    String2 would have String1's text but without any formatting... i'am unsure how to copy everything over also?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please show the string that contains the formatting properties. Do you mean with Rich Text Format tags in place? Generally a string does not contain it's own formatting properties. How did you set the properties? https://en.wikipedia.org/wiki/Rich_Text_Format
     
  3. CyberInteractiveLLC

    CyberInteractiveLLC

    Joined:
    May 23, 2017
    Posts:
    307
    Following worked for me:

    TextBox1.Copy();
    TextBox2.Paste();
     
    JeffDUnity3D likes this.