Is good to call function in other function parameter?

后端 未结 3 1808
囚心锁ツ
囚心锁ツ 2021-01-16 08:13

I suppose this:

public static string abc()
{
    return \"abc\";
}

Is better to call this function in this way:

string call         


        
3条回答
  •  暖寄归人
    2021-01-16 08:57

    Actually I don't see a difference if you don't have any error checking.

    This would make a difference

    string call = abc();
    # if call is not empty
    {
        Console.writeline(call);
    }
    

    The above method could avoid empty string being written.

提交回复
热议问题