如何在C#中将其更改为String.Format

Har*_*aid 2 c# string command-line ffmpeg code-formatting

原版的

string strCommandLineArgs = (((("-i" + " ") + strVideoPath + " -vcodec mjpeg -vframes 1 -an -f rawvideo -s ") + intWidth.ToString() + "x") + intHeight.ToString() + " ") + strImagePath + " -ss 2";
Run Code Online (Sandbox Code Playgroud)

我做到了这一点

string strCommandLineArgs = string.Format("-i {0} -vcodec mjpeg -vframes 1 -an -f rawvideo -s {1}x{2} {3} -ss 2", strVideoPath, intWidth, intHeight, strImagePath);
Run Code Online (Sandbox Code Playgroud)

我无法找到使用()字符串的区别.

Ada*_*ear 5

没有区别.括号不会为字符串添加任何特殊内容.