相关疑难解决方法(0)

我可以在运行时扩展包含C#文字表达式的字符串

如果我有一个包含ac#string文字表达式的字符串,我可以在运行时"展开"它

    public void TestEvaluateString()
    {
        string Dummy = EvalString( @"Contains \r\n new line");
        Debug.Assert(Dummy == "Contains \r\n new line");
    }

    private string EvalString(string input)
    {
        return "Contains \r\n new line";
    }
Run Code Online (Sandbox Code Playgroud)

就像我可以将C#字符串值转换为转义字符串文字,但反过来?

c#

8
推荐指数
2
解决办法
4248
查看次数

标签 统计

c# ×1