We will try to return a string like: “I can text whatever I want with 4 different options in C#. ” with String Interpolation, String Format, String Concat, and String Builder.
public class StringOptions { private string data1 = "4"; private string data2 = "C#"; public string StringInterpolation() => ($"I can text whatever I want with {data1} different options in {data2}."); public string StringFormat() => string.Format("I can text whatever I want with {0} different options in {1}.", data1, data2); public string StringConcat() => "I can text whatever I want with " + data1 + " different options in " + data2 + "."; public string StringBuilder() => (new StringBuilder()).Append("I can text whatever I want with ").Append(data1).Append(" different options in ").Append(data2).Append(".").ToString(); }