开发者

C# - Using a methods string in another method

I currently have a method that removes duplicates from a line, although the output is currently going into a new file. How could I instead use the output as a string and then use it in another 开发者_开发百科method:


Well, you can store the return value of the first method in a variable and pass it to the second method (after modifying the second to accept an argument):

var str = RemoveDuplicate(someValue, someOtherValue);
CompareFiles(str);

The second method would need to be defined with an argument:

private static void CompareFiles(string someValue)
{
    // implementation
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜