Search Unity

String Interpolation [Solved]

Discussion in 'Scripting' started by kdubnz, Jul 14, 2018.

  1. kdubnz

    kdubnz

    Joined:
    Apr 19, 2014
    Posts:
    177
    In 1018.2

    Is there a way to use String Interpolation in the VS IDE?

    Regards,
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Sure. You just need to choose .NET 4.x instead of 3.5 in Player Settings. My code is full of stuff like this:

    Code (CSharp):
    1. var s  = $"There have been {counter} things so far";
     
  3. kdubnz

    kdubnz

    Joined:
    Apr 19, 2014
    Posts:
    177
    Thanks dgoyette,

    For others that is Edit -> Project Settings -> Player .... Other Settings - Configuration - Scripting Runtime Version

    upload_2018-7-14_20-49-53.png